index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. <template>
  2. <view class="container">
  3. <!-- shipping_method 发货方式:0邮寄 1自提 2邮寄自提 -->
  4. <template v-if="Data.is_sell != 1">
  5. <div class="qtmd mar_b20" v-if="goodsInfo.shipping_method == 2">
  6. <view class="order_list flex_r flex_ac flex_jb">
  7. <view class="list_name">发货方式</view>
  8. <view class="list_con flex_r flex_jb">
  9. <div class="select_tab" @click="onprom(0)" :class="{st_active:prom_type===0}">快递邮寄</div>
  10. <div class="select_tab" @click="onprom(1)" :class="{st_active:prom_type===1}">到店自提</div>
  11. </view>
  12. </view>
  13. </div>
  14. <div class="qtmd mar_b20" v-else>
  15. <view class="order_list flex_r flex_ac flex_jb">
  16. <view class="list_name">发货方式</view>
  17. <view class="list_con flex_r flex_jb">
  18. <div class="list_con" v-if="prom_type==0">快递邮寄</div>
  19. <div class="list_con" v-else>到店自提</div>
  20. </view>
  21. </view>
  22. </div>
  23. </template>
  24. <!-- 收货地址 -->
  25. <!-- is_sell 0:邮寄 1:寄售 prom_type 0:邮寄 1:自提 -->
  26. <view class="address mar_b20" v-if="Data.is_sell != 1 && prom_type != 1">
  27. <block v-if="DefaultAddress.name">
  28. <view class="add_head flex_r flex_ac flex_jb">
  29. <view class="user_info flex_r flex_ac">
  30. <view class="user_name">{{ DefaultAddress.name }}</view>
  31. <view class="user_phone">{{ DefaultAddress.mobile }}</view>
  32. </view>
  33. <view class="set_address flex_r flex_ac" @tap="chooseWXaddress">
  34. <image class="set_img" src="/static/img/setAddress.png" mode=""></image>
  35. <view class="set_text">修改</view>
  36. </view>
  37. </view>
  38. <view class="add_name mar_t20">{{ DefaultAddress.province + ' ' + DefaultAddress.city + ' ' + DefaultAddress.area + ' ' + DefaultAddress.street + ' ' + DefaultAddress.address }}</view>
  39. </block>
  40. <block v-else>
  41. <view class="add_address flex_c flex_ac flex_jc" @tap="chooseWXaddress('add')">
  42. <image class="add_icon" src="/static/img/add.png" mode=""></image>
  43. <view class="add_text">添加收货地址</view>
  44. </view>
  45. </block>
  46. </view>
  47. <!-- 收货地址-end -->
  48. <!-- 商品信息 -->
  49. <view class="goods_info mar_b20">
  50. <view class="info_type" v-if="Data.type != 1">{{ modularName }}</view>
  51. <view class="goods flex_r">
  52. <image class="goods_img" :src="goodsInfo.original_img" mode=""></image>
  53. <view class="goods_con flex_c flex_jc flex_jb">
  54. <view class="goods_name ellipsis2">{{ goodsInfo.goods_name }}</view>
  55. <!-- <view class="goods_msg" v-if="Data.type == 2">{{ goodsInfo.trade_price }}元+{{ goodsInfo.trade_num }}批发券+{{ goodsInfo.treasure_price }}贡献值</view> -->
  56. <view class="goods_spec">
  57. <text class="goods_spec_text" v-if="specName">{{ specName }}</text>
  58. <text v-if="attrName">{{ attrName }}</text>
  59. </view>
  60. <template v-if="Data.type != 1">
  61. <view class="goods_msg">{{ goodsInfo.cost_price }}</view>
  62. <view class="goods_num">x {{ Data.num }}</view>
  63. </template>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 商品信息-end -->
  68. <!-- 订单信息 -->
  69. <view class="order mar_b20">
  70. <view class="info_type" v-if="Data.type == 1">{{ modularName }}</view>
  71. <view class="order_list flex_r flex_ac flex_jb">
  72. <view class="list_name">数量</view>
  73. <view class="list_con">{{ Data.num }}</view>
  74. </view>
  75. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  76. <view class="list_name">商品单价</view>
  77. <view class="list_con">{{ parseFloat(goodsInfo.teac) }} TeaC</view>
  78. </view>
  79. <view class="order_list flex_r flex_ac flex_jb" v-else>
  80. <view class="list_name">商品单价</view>
  81. <view class="list_con">¥{{ parseFloat(goodsInfo.cost_price) }}</view>
  82. </view>
  83. <template v-if="Data.type != 1">
  84. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.is_sell != 1 && prom_type != 1 && freight > 0">
  85. <view class="flex_r flex_ac">
  86. <view class="list_name">运费</view>
  87. <view class="list_con p_color">({{ freight }}元/每套)</view>
  88. </view>
  89. <view class="list_con">¥{{ $h.Mul(freight, Data.num) }}</view>
  90. </view>
  91. </template>
  92. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2 || Data.type == 5">
  93. <view class="flex_r flex_ac">
  94. <view class="list_name">贡献值</view>
  95. <view class="list_con p_color">(可用{{ userinfo.cha_bao }})</view>
  96. </view>
  97. <view class="list_con" v-if="Data.type != 5">{{ goodsInfo.treasure_price * Data.num }} 贡献值</view>
  98. <view class="list_con" v-else>{{ $h.Mul(goodsInfo.cha_bao, Data.num) }} 贡献值</view>
  99. </view>
  100. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 8">
  101. <view class="flex_r flex_ac">
  102. <view class="list_name">OE</view>
  103. <view class="list_con p_color">(可用{{ localInfo.original_equity }})</view>
  104. </view>
  105. <view class="list_con">{{ $h.Mul(goodsInfo.oe_price, Data.num) }} OE</view>
  106. </view>
  107. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 7">
  108. <view class="flex_r flex_ac">
  109. <view class="list_name">消费券</view>
  110. <view class="list_con p_color">(可用{{ localInfo.integral }})</view>
  111. </view>
  112. <view class="list_con">{{ $h.Mul(goodsInfo.consume, Data.num) }} 消费券</view>
  113. </view>
  114. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 2">
  115. <view class="flex_r flex_ac">
  116. <view class="list_name">批发券</view>
  117. <view class="list_con p_color">(可用{{ userinfo.integral }})</view>
  118. </view>
  119. <view class="list_con">{{ $h.Mul(goodsInfo.trade_num, Data.num) }} 批发券</view>
  120. </view>
  121. <template v-if="Data.type==4 && isAct">
  122. <view class="order_list flex_r flex_ac flex_jb">
  123. <view class="list_name">商品原价</view>
  124. <view class="list_con">¥{{ originalPrice }}</view>
  125. </view>
  126. <view class="order_list flex_r flex_ac flex_jb">
  127. <view class="flex_r flex_ac">
  128. <view class="list_name">消费券抵</view>
  129. <view class="list_con p_color">(可用 {{ parseFloat(localInfo.integral) }})</view>
  130. </view>
  131. <view class="list_con p_color">-¥{{ goldNum }}</view>
  132. </view>
  133. </template>
  134. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  135. <view class="list_name">小计</view>
  136. <view class="list_con">{{ $h.Mul(goodsInfo.teac, Data.num) }} TeaC</view>
  137. </view>
  138. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  139. <view class="list_name">贡献值</view>
  140. <view class="list_con">{{ $h.Mul(goodsInfo.treasure_price, Data.num) }} 贡献值</view>
  141. </view>
  142. <view class="order_list flex_r flex_ac flex_jb" v-else>
  143. <view class="list_name">小计</view>
  144. <view class="list_con">¥{{ CommodityPrice>0?CommodityPrice:0 || 0 }}</view>
  145. </view>
  146. </view>
  147. <view class="order mar_b20" v-if="Data.type == 1">
  148. <view class="info_type">批发专区</view>
  149. <view class="order_list flex_r flex_ac flex_jb">
  150. <view class="list_name">数量</view>
  151. <view class="list_con">{{ Data.num * 2 }}</view>
  152. </view>
  153. <view class="order_list flex_r flex_ac flex_jb">
  154. <view class="list_name">商品单价</view>
  155. <view class="list_con">{{ parseFloat(goodsInfo.trade_teac) }} TeaC</view>
  156. </view>
  157. <!-- <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type != 1">
  158. <view class="list_name">小计</view>
  159. <view class="list_con">¥{{ wholesalePriceTotal || 0 }}</view>
  160. </view> -->
  161. <view class="order_list flex_r flex_ac flex_jb">
  162. <view class="list_name">小计</view>
  163. <view class="list_con">{{($h.Mul(goodsInfo.trade_teac, Data.num * 2) || 0) +' TeaC'}}</view>
  164. </view>
  165. <view class="order_list flex_r flex_ac flex_jb">
  166. <view class="flex_r flex_ac">
  167. <view class="list_name">寄卖服务</view>
  168. <view class="list_con p_color">({{ goodsInfo.service }}元/每套)</view>
  169. </view>
  170. <view class="list_con">¥{{ $h.Mul(goodsInfo.service, Data.num * 2) }}</view>
  171. </view>
  172. </view>
  173. <view class="order">
  174. <view class="order_list flex_r flex_ac flex_jb">
  175. <view class="list_name">订单合计</view>
  176. <view class="list_con" v-if="Data.type == 1">{{($h.Add($h.Mul(goodsInfo.teac, Data.num),$h.Mul(goodsInfo.trade_teac, Data.num * 2))||0) +'TeaC + '+(($h.Mul(goodsInfo.treasure_price, Data.num)) || 0) }}贡献值 + ¥{{ $h.Mul(goodsInfo.service, Data.num * 2) }}</view>
  177. <view class="list_con" v-else>¥{{ amountTotal>0?amountTotal:0 || 0 }}</view>
  178. </view>
  179. <view class="order_list flex_r flex_ac flex_jb" v-if="['2','3'].includes(Data.type)">
  180. <view class="list_name">可用云宝</view>
  181. <view class="list_con g_color">¥{{ userinfo.user_money }}</view>
  182. </view>
  183. <view class="order_list flex_r flex_ac flex_jb" v-if="['2','3', '4', '5', '7', '8'].includes(Data.type) && isAct">
  184. <view class="list_name">我的付宝</view>
  185. <view class="list_con g_color">{{ localInfo.property }}</view>
  186. </view>
  187. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  188. <view class="list_name">可用TeaC</view>
  189. <view class="list_con g_color">{{ userinfo.teac }}</view>
  190. </view>
  191. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  192. <view class="list_name">可用贡献值</view>
  193. <view class="list_con g_color">{{ userinfo.cha_bao }}</view>
  194. </view>
  195. <view class="order_list flex_r flex_ac flex_jb" v-if="Data.type == 1">
  196. <view class="list_name">付宝</view>
  197. <view class="list_con g_color">¥{{ localInfo.property }}</view>
  198. </view>
  199. </view>
  200. <view class="msginfo" v-if="Data.type == 1">
  201. <view class="title">特别提示</view>
  202. <view>1、寄卖服务费只能使用您的付宝抵扣或微信支付</view>
  203. </view>
  204. <!-- 订单信息-end -->
  205. <!-- 底部操作栏 -->
  206. <view class="bar flex_r flex_ac flex_jb">
  207. <!-- <view class="bar_info flex_r flex_ac" v-if="Data.type == 1">待支付<text>¥{{ $h.Mul(goodsInfo.service, Data.num * 2) }}</text></view> -->
  208. <view class="bar_info flex_r flex_ac">待支付<text>¥{{ obligation }}</text></view>
  209. <view class="pay_btn flex_r flex_ac flex_jc" @tap="payment">立即支付</view>
  210. </view>
  211. <!-- 底部操作栏-end -->
  212. <!-- 收货地址弹窗 -->
  213. <userAddress ref="userAddress" @addressConfirm="loadDa" />
  214. </view>
  215. </template>
  216. <script>
  217. import { post } from "@/request/api.js";
  218. import { ToPayOpre } from "@/utils/reqTools.js";
  219. let toPayOpre = new ToPayOpre();
  220. import userAddress from "pages/xghc-addrress/userAddress";
  221. export default {
  222. data() {
  223. return {
  224. Data: {},
  225. goodsInfo: "", //商品信息
  226. modularName: "", //商品类型
  227. DefaultAddress: {}, //用户默认地址
  228. originalPrice: 0, //商品原价(总价)
  229. CommodityPrice: 0, //商品折扣后价格(总价)
  230. wholesalePriceTotal: 0, //批发总价
  231. obligation: 0, //待支付 (可以理解为必须微信支付的)
  232. freight: 0, //运费
  233. goldNum: 0, //消费券抵扣
  234. amountTotal: 0, //合计
  235. userinfo: uni.getStorageSync("userinfo"),
  236. localInfo: uni.getStorageSync("localInfo"),
  237. prom_type: 0, //0:邮寄 1:自提
  238. isAct: false, //是否激活数智生活,
  239. specName: "",
  240. attrName: ""
  241. };
  242. },
  243. components: {
  244. userAddress,
  245. },
  246. onLoad(e) {
  247. this.Data = e;
  248. this.isActivation(); //查询是否激活数智生活
  249. this.loadAddress(); //获取收货地址
  250. this.loadData(e); //加载订单商品数据
  251. this.modularName = this.tidyTpye(e.type);
  252. },
  253. computed: {},
  254. methods: {
  255. onprom(va) {
  256. this.prom_type = va
  257. this.loadData(this.Data);
  258. },
  259. // 是否激活数智生活
  260. async isActivation() {
  261. let res = await post("local/isActivation", this.Query);
  262. if (res.code === 0) {
  263. this.isAct = true
  264. } else {
  265. uni.hideToast();
  266. this.isAct = false
  267. }
  268. },
  269. loadData(da) {
  270. post("v1/goods/goodsDetail", da).then((res) => {
  271. if (res.code === 0) {
  272. this.goodsInfo = res.data.data;
  273. let attr_list=[]
  274. if (this.goodsInfo.goods_spec_list.length > 0) {
  275. let list= this.goodsInfo.goods_spec_list.filter((item)=>{
  276. return item.id == this.Data.spec_id
  277. })[0]
  278. this.specName = list.spec_name;
  279. attr_list = list.attr_list
  280. }
  281. if (attr_list.length > 0) {
  282. this.attrName = attr_list.filter((item)=>{
  283. return item.id == this.Data.attr_id
  284. })[0].attr_name
  285. }
  286. post("v1/goods/getPrice", {
  287. goods_id: this.Data.goods_id,
  288. spec_id: this.Data.spec_id,
  289. attr_id: this.Data.attr_id,
  290. type: this.Data.type
  291. }).then((resPrice) => {
  292. if (resPrice.code === 0) {
  293. if(resPrice.data){
  294. this.goodsInfo.cost_price = resPrice.data.cost_price;
  295. }
  296. }
  297. if (this.goodsInfo.shipping_method != 2) this.prom_type = this.goodsInfo.shipping_method
  298. if(da.type==1)this.calculatePrice(1,this.Data.num);
  299. else{
  300. post("v1/goods/freight", { type: da.type, id: da.id }).then((resFreight) => {
  301. if (resFreight.code === 0) this.freight = resFreight.data.freight;
  302. this.calculatePrice(this.Data.type,this.Data.num);
  303. });
  304. }
  305. });
  306. }
  307. });
  308. },
  309. getPrice(){
  310. post("v1/goods/getPrice", {
  311. goods_id: this.Data.goods_id,
  312. spec_id: this.Data.spec_id,
  313. attr_id: this.Data.attr_id,
  314. type: this.Data.type
  315. }).then((res) => {
  316. if (res.code === 0) {
  317. if(res.data){
  318. this.goodsInfo.cost_price = res.data.cost_price
  319. }
  320. }
  321. });
  322. },
  323. calculatePrice(type,num){
  324. setTimeout(() => {
  325. // 计算待支付
  326. let p = this.goodsInfo.cost_price; //商品单价
  327. let y = (this.prom_type == 1 || this.Data.is_sell == 1 || type == 1) ? 0 : this.freight; // 运费单价 寄卖、自提 运费为0
  328. let ps = this.$h.Mul(p, num); //商品总价
  329. let ys = this.$h.Mul(y, num); //运费总价
  330. let a = this.$h.Add(ps, ys); //商品总价加运费
  331. this.originalPrice = ps; this.CommodityPrice = ps; this.amountTotal = ps;
  332. let wy = this.$h.Mul(this.goodsInfo.service, num*2); //寄卖服务费
  333. if (type == 1) {
  334. let wp = this.$h.Mul(this.goodsInfo.cost_price, num*2*0.2); // 批发价字段去除了 零售价+2*(零售价 *0.2+寄卖服务价)
  335. let wpt = this.$h.Add(wp,wy)
  336. this.wholesalePriceTotal = wpt;
  337. this.amountTotal = this.$h.Add(wpt,this.amountTotal)
  338. ps = this.$h.Add(ps, wp);
  339. }
  340. let um = 0; //可用付宝
  341. if (this.isAct) um = this.localInfo.property; //可用付宝
  342. let userBalance = this.$h.Add(this.userinfo.user_money, um); //用户总余额(可用付宝+云宝)
  343. let b = this.$h.Sub(a, userBalance); //待支付金额
  344. let b1 = this.$h.Sub(ps, userBalance); //待支付金额 - 零售&批发&云宝货易 运费必须现金支付
  345. let obligation = 0;
  346. if (type == 1) {
  347. // b1 = this.$h.Sub(ps, this.userinfo.user_money); //用云宝计算后 待支付价格
  348. b1 = this.$h.Sub(ps,um); // 寄卖服务待支付价格不使用云宝
  349. let sp = this.$h.Sub(wy,um); //寄卖服务费只能用数智生活付宝抵扣或微信支付
  350. obligation = b1 > 0 ? b1 : 0;
  351. obligation = this.$h.Add(obligation,sp > 0 ? sp : 0);
  352. }
  353. else if (type == 4) {
  354. if (this.isAct) {
  355. let up = this.localInfo.integral; //数智生活消费券
  356. let goldnum = this.$h.Mul(this.goodsInfo.consume, num); //商品消费券 可抵金额
  357. this.goldNum = up > goldnum ? goldnum : up; //可抵金额,消费券不够及余额多少抵多少
  358. let sp = this.$h.Sub(ps, this.goldNum); //抵扣后价格
  359. this.CommodityPrice = sp; this.amountTotal = sp;
  360. let b2 = this.$h.Sub(sp, um); //消费券电商 可以使用数智生活佣金支付
  361. obligation = b2 > 0 ? b2 : 0;
  362. } else obligation = a;
  363. }
  364. else if (type == 5 || type == 8 || type == 7) {
  365. obligation = this.$h.Sub(a, um)> 0 ? this.$h.Sub(a, um) : 0;
  366. }
  367. else if (["6"].includes(type)) obligation = a;
  368. else if (["3"].includes(type)) obligation = b1 > 0 ? this.$h.Add(b1, ys) : ys;
  369. else obligation = b > 0 ? b : 0;
  370. this.obligation = obligation;
  371. }, 100);
  372. },
  373. // 获取用户地址
  374. async loadAddress() {
  375. let res = await post("v1/user/addressList");
  376. if (res.code === 0) {
  377. let da = res.data.data;
  378. if (da.length) {
  379. for (const i of da) {
  380. if (i.status == 1) {
  381. this.DefaultAddress = i;
  382. break;
  383. } else this.DefaultAddress = da[0];
  384. }
  385. }
  386. }
  387. },
  388. //获取微信的收货地址
  389. getwexinAddress() {
  390. let that = this
  391. uni.chooseAddress({
  392. success(res) {
  393. console.log(res);
  394. if (res.errMsg == "chooseAddress:ok") {
  395. let data = {
  396. province: res.provinceName,
  397. city: res.cityName,
  398. area: res.countyName,
  399. street: res.streetName,
  400. address: res.detailInfo,
  401. mobile: res.telNumber,
  402. name: res.userName,
  403. is_default: 0,
  404. };
  405. post("v1/user/addAddress", data).then((res) => {
  406. if (res.code === 0) {
  407. that.$toast(res.msg);
  408. that.loadAddress();
  409. }
  410. });
  411. }
  412. },
  413. });
  414. },
  415. chooseWXaddress(va) {
  416. let a = va != "add" ? this.DefaultAddress.id : "add";
  417. this.$refs.userAddress.open(a);
  418. },
  419. // 支付
  420. payment() {
  421. let that = this
  422. if (that.obligation == 0) {
  423. uni.showModal({
  424. title: "温馨提示",
  425. content: "你将支付该订单,请确认。",
  426. showCancel: true,
  427. confirmText: "确认",
  428. confirmColor: "#f02f2f",
  429. success(res) {
  430. if (res.confirm) {
  431. that.Pay();
  432. }
  433. },
  434. });
  435. } else {
  436. that.Pay();
  437. }
  438. },
  439. async Pay() {
  440. let trade_type = "jsapi";
  441. // #ifdef  H5
  442. trade_type = "H5";
  443. // #endif
  444. // #ifdef  APP
  445. trade_type = "app";
  446. // #endif
  447. // #ifdef  MP-WEIXIN
  448. trade_type = "jsapi";
  449. // #endif
  450. let that = this
  451. let adres = await uni.Location();
  452. post("v1/goods/submitOrder", {
  453. ...that.Data,
  454. address_id: that.DefaultAddress.id || '',
  455. regional_code: that.DefaultAddress.regional_code || '',
  456. trade_type: trade_type,
  457. prom_type: that.prom_type,
  458. price: that.goodsInfo.cost_price,
  459. location: "+"+adres.lat+'/+'+adres.lng
  460. }).then((res) => {
  461. if (res.code === 0) {
  462. if(res.data && res.data != 200){
  463. let data = {
  464. ...res.data,
  465. appId:res.data.app_id,
  466. nonceStr:res.data.nonce_str,
  467. package:res.data.package,
  468. signType:res.data.sign_type,
  469. paySign:res.data.pay_sign,
  470. timeStamp:res.data.time_stamp,
  471. prepayid:res.data.prepay_id
  472. }
  473. // data.prepayid = data.package?data.package.split('prepay_id=')[1]:''
  474. if (res.code == 0 && data.prepayid) {
  475. toPayOpre.toPay(data, (rea) => {
  476. if (!rea) {
  477. // 支付成功
  478. this.$toast("支付成功");
  479. setTimeout(() => {
  480. that.goto("/pages/szw-order-list/index");
  481. }, 1500);
  482. } else {
  483. // 支付失败
  484. this.$toast("支付已取消");
  485. }
  486. });
  487. }
  488. } else {
  489. this.$toast("支付成功");
  490. setTimeout(() => {
  491. that.goto("/pages/szw-order-list/index");
  492. }, 1500);
  493. }
  494. } else {
  495. that.loadData(that.Data);
  496. }
  497. });
  498. },
  499. loadDa(da) {
  500. this.DefaultAddress = da;
  501. },
  502. // 获取userinfo
  503. async getuserInfo() {
  504. this.userinfo = await uni.userfun();
  505. },
  506. async getLU() {
  507. this.localInfo = await uni.Luserfun()
  508. },
  509. },
  510. };
  511. </script>
  512. <style lang="scss">
  513. // 页面配置
  514. page {
  515. background: #f5f5f5;
  516. }
  517. .container {
  518. padding: 20rpx 20rpx 150rpx;
  519. box-sizing: border-box;
  520. }
  521. // 页面配置-end
  522. // 收货地址
  523. .user_phone {
  524. font-size: 26rpx;
  525. color: #222;
  526. }
  527. .set_text {
  528. font-size: 24rpx;
  529. color: #868686;
  530. }
  531. .set_img {
  532. width: 24rpx;
  533. height: 24rpx;
  534. margin-right: 9rpx;
  535. }
  536. .add_address {
  537. width: 100%;
  538. overflow: hidden;
  539. height: 109rpx;
  540. }
  541. .add_icon {
  542. width: 60rpx;
  543. height: 60rpx;
  544. margin-bottom: 12rpx;
  545. }
  546. .user_name {
  547. font-size: 32rpx;
  548. color: #000;
  549. margin-right: 46rpx;
  550. }
  551. .add_name {
  552. // width: 448rpx;
  553. // overflow: hidden;
  554. font-size: 24rpx;
  555. color: #868686;
  556. }
  557. .add_text {
  558. font-size: 24rpx;
  559. color: #868686;
  560. font-family: "SourceHanSansCN-Normal";
  561. }
  562. .address {
  563. width: 100%;
  564. overflow: hidden;
  565. padding: 28rpx;
  566. box-sizing: border-box;
  567. background: #fff;
  568. border-radius: 12rpx;
  569. }
  570. // 收货地址-end
  571. // 商品信息
  572. .goods:nth-last-child(1) {
  573. margin-bottom: 0;
  574. }
  575. .goods_num {
  576. // text-align: right;
  577. font-size: 26rpx;
  578. color: #989898;
  579. position: absolute;
  580. bottom: 0;
  581. right: 0;
  582. }
  583. .goods_con {
  584. width: calc(100% - 202rpx - 36rpx);
  585. min-height: 187rpx;
  586. position: relative;
  587. // overflow: hidden;
  588. }
  589. .goods {
  590. width: 100%;
  591. overflow: hidden;
  592. margin-bottom: 20rpx;
  593. align-items: initial;
  594. }
  595. .goods_img {
  596. width: 202rpx;
  597. height: 187rpx;
  598. margin-right: 36rpx;
  599. border-radius: 12rpx;
  600. }
  601. .goods_name {
  602. font-size: 34rpx;
  603. color: #1b1b1b;
  604. font-family: "SourceHanSansCN-Bold";
  605. font-weight: bold;
  606. }
  607. .goods_msg {
  608. overflow: hidden;
  609. font-size: 26rpx;
  610. color: #18bb88;
  611. font-family: "SourceHanSansCN-Medium";
  612. font-weight: 500;
  613. }
  614. .info_type {
  615. font-size: 30rpx;
  616. color: #353535;
  617. font-family: "SourceHanSansCN-Bold";
  618. font-weight: bold;
  619. margin-bottom: 43rpx;
  620. }
  621. .goods_info {
  622. width: 100%;
  623. overflow: hidden;
  624. padding: 28rpx;
  625. background: #fff;
  626. border-radius: 12rpx;
  627. box-sizing: border-box;
  628. }
  629. .goods_spec{
  630. font-size: 24rpx;
  631. color: #868686;
  632. text{
  633. padding: 10rpx 20rpx;
  634. border-radius: 10rpx;
  635. margin-right: 12rpx;
  636. background-color: #f5f5f5;
  637. }
  638. &_text{
  639. padding-right: 8rpx;
  640. }
  641. }
  642. // 商品信息-end
  643. // 订单信息
  644. .list_name {
  645. width: 120rpx;
  646. font-size: 26rpx;
  647. text-align-last: justify;
  648. color: rgba(0, 0, 0, 0.8);
  649. font-weight: bold;
  650. margin-right: 12rpx;
  651. }
  652. .order_list:nth-last-child(1) {
  653. margin-bottom: 0;
  654. }
  655. .order_list {
  656. width: 100%;
  657. overflow: hidden;
  658. margin-bottom: 30rpx;
  659. }
  660. .list_con {
  661. font-size: 24rpx;
  662. color: #000;
  663. font-family: "SourceHanSansCN-Medium";
  664. font-weight: bold;
  665. line-height: 1;
  666. }
  667. .order {
  668. width: 100%;
  669. overflow: hidden;
  670. padding: 28rpx;
  671. box-sizing: border-box;
  672. background: #fff;
  673. border-radius: 12rpx;
  674. }
  675. .list_name text {
  676. font-size: 26rpx;
  677. color: rgba(0, 0, 0, 0.8);
  678. font-family: "SourceHanSansCN-Medium";
  679. font-weight: bold;
  680. line-height: 1;
  681. }
  682. .p_color {
  683. color: #ff6d44;
  684. }
  685. .g_color {
  686. color: #18bb88;
  687. }
  688. // 订单信息-end
  689. // 底部操作栏
  690. .bar_info {
  691. font-size: 24rpx;
  692. color: #000;
  693. font-family: "SourceHanSansCN-Medium";
  694. font-weight: bold;
  695. }
  696. .bar_info text {
  697. font-size: 30rpx;
  698. color: #ff6d44;
  699. font-family: "SourceHanSansCN-Medium";
  700. font-weight: bold;
  701. }
  702. .pay_btn {
  703. width: 187rpx;
  704. height: 72rpx;
  705. font-size: 30rpx;
  706. font-family: "SourceHanSansCN-Medium";
  707. font-weight: bold;
  708. background: #2db48a;
  709. border-radius: 36rpx;
  710. color: #fff;
  711. }
  712. .bar {
  713. width: 100%;
  714. overflow: hidden;
  715. position: fixed;
  716. bottom: 0;
  717. left: 0;
  718. background: #fff;
  719. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.15);
  720. padding: 14rpx 30rpx;
  721. box-sizing: border-box;
  722. }
  723. // 底部操作栏-end
  724. .qtmd {
  725. width: 100%;
  726. padding: 28rpx;
  727. box-sizing: border-box;
  728. background: #fff;
  729. border-radius: 12rpx;
  730. .select_tab {
  731. margin-left: 30rpx;
  732. font-size: 28rpx;
  733. &:first-child {
  734. margin-left: 0;
  735. }
  736. &::before {
  737. content: "";
  738. display: inline-block;
  739. width: 32rpx;
  740. height: 32rpx;
  741. background-image: url("~@/static/img/weixuanzhong_icon.png");
  742. background-size: 100% 100%;
  743. vertical-align: middle;
  744. margin-right: 6rpx;
  745. }
  746. }
  747. .st_active {
  748. &::before {
  749. background-image: url("~@/static/img/xuanzhong_icon.png");
  750. }
  751. }
  752. }
  753. .msginfo{
  754. font-size: 24rpx;
  755. color: #999;
  756. margin-top: 30rpx;
  757. .title {
  758. color: #666;
  759. font-size: 26rpx;
  760. height: 26rpx;
  761. line-height: 26rpx;
  762. // padding-left: 12rpx;
  763. // border-left: 6rpx solid #00b76c;
  764. margin-bottom: 16rpx;
  765. }
  766. }
  767. </style>