create-order.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. <template>
  2. <view class="container order clearfix" :style="{ paddingBottom: isIphoneX ? '190rpx' : '134rpx' }">
  3. <!-- 地址选择 -->
  4. <cm-address-temp ref="choiceAddress" v-if="isAddress" :addressData="addressData" />
  5. <!-- 商品 -->
  6. <cm-goods-temp
  7. ref="goods"
  8. v-if="isRequest"
  9. :secondflag="secondflag"
  10. :goodsData.sync="goodsData"
  11. @handleGoodList="handChangeInputGoodsList"
  12. @changeChina="handleChangeChina"
  13. @changePostage="handleChangePostage"
  14. />
  15. <!-- 返佣订单 -->
  16. <!-- <view class="order-return" v-if="goodsData.length == 1 && secondflag">
  17. <view class="order-return-main" @click="handleRebateFlag">
  18. <view class="label">是否返佣</view>
  19. <view class="label-right">
  20. <text class="text-l">{{ rebateFeeText }}</text> <text class="iconfont icon-xiayibu"></text>
  21. </view>
  22. </view>
  23. <view class="order-return-input" v-if="confirmParam.payInfo.rebateFlag === 2">
  24. <input class="input" v-model="rebateFee" type="number" placeholder="请输入返佣服务费" maxlength="20" />
  25. </view>
  26. </view> -->
  27. <!-- 返佣订单 -->
  28. <!-- <view class="Rebate" @click="handleSecondFlag" v-if="!secondflag">
  29. <text class="rebate-title">二手返佣订单</text>
  30. <text class="iconfont" :class="rebatecheck ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
  31. </view> -->
  32. <!-- 发票信息 -->
  33. <cm-invice-popup
  34. ref="invoice"
  35. v-if="isRequest"
  36. :invoiceDatas="invoiceData"
  37. @handleChoiceaInvoice="handleChoiceaInvoiceData"
  38. />
  39. <!-- 优惠券选择弹窗 -->
  40. <cm-coupon-popup
  41. ref="coupon"
  42. v-if="isCouponShow"
  43. :couponList="couponList"
  44. @handleChoiceaCoupon="handleChoiceaCouponData"
  45. />
  46. <!-- 兑换优惠券弹窗 -->
  47. <cm-coupon-chang v-if="isExchangePopup" />
  48. <!-- 余额抵扣 -->
  49. <view class="invoice-balance" v-if="!rechargeGoods">
  50. <view class="balabce-t">
  51. <view class="balabce-t-le">余额抵扣</view>
  52. <view class="balabce-t-ri">
  53. <view class="money">
  54. <text>可用余额:</text> <text>¥{{ userMoney | NumFormat }}</text>
  55. </view>
  56. <view class="checkbox-box">
  57. <button
  58. class="checkbox iconfont"
  59. hover-class="btn-hover"
  60. v-if="userMoney != 0"
  61. @click.stop="checkedBalabce"
  62. :class="[ischecked ? 'icon-yixuanze' : 'icon-weixuanze']"
  63. ></button>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="balabce-b" :class="{ 'balabce-b--hide': !ischecked }">
  68. <view
  69. class="balabce-b-text animation"
  70. :style="{
  71. transform: ischecked ? 'translateY(0)' : 'translateY(-50%)',
  72. '-webkit-transform': ischecked ? 'translateY(0)' : 'translateY(-50%)'
  73. }"
  74. >
  75. <text>当前使用:¥{{ deductMoney | NumFormat }},剩余:¥{{ surplusMoney | NumFormat }}</text>
  76. </view>
  77. </view>
  78. </view>
  79. <!-- 选择对机构是否可见 -->
  80. <cm-club-visible ref="clubVisible" v-if="isRequest" @handleClubVisible="handleClubVisibleData" />
  81. <!-- 售后条例 -->
  82. <cm-regula-popup
  83. ref="regulations"
  84. v-if="isRequest && seconDepositFlg"
  85. :regulaDatas="clauseList"
  86. @handleData="handleClauseData"
  87. />
  88. <!-- 底部 -->
  89. <view class="footer" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0rpx' }">
  90. <view class="footer-le">
  91. <view class="footer-count">
  92. <text>共{{ totalCount }}件商品</text>
  93. </view>
  94. <view class="footer-price">
  95. <view class="sum" :class="totalDiscountAmount == 0 ? 'none' : ''">
  96. 总价:<text class="price">¥{{ orderShouldPayFee | NumFormat }}</text>
  97. </view>
  98. <view class="sum-none" v-if="totalDiscountAmount > 0">
  99. <text class="money-reduced"
  100. >共减<text>¥{{ totalDiscountAmount | NumFormat }}</text></text
  101. >
  102. </view>
  103. </view>
  104. </view>
  105. <view class="footer-submit" @click.stop="orderSubmitMit">
  106. <view class="btn" :class="isSubLoading ? 'disabled' : ''">提交订单</view>
  107. </view>
  108. </view>
  109. <!-- 弹窗提示 -->
  110. <tui-modal
  111. :show="modal"
  112. @click="handleClick"
  113. @cancel="hideMobel"
  114. :content="contentModalText"
  115. :button="modalButton"
  116. color="#333"
  117. :size="32"
  118. shape="circle"
  119. :maskClosable="false"
  120. >
  121. </tui-modal>
  122. </view>
  123. </template>
  124. <script>
  125. import cmAddressTemp from './components/cm-address-temp'
  126. import cmGoodsTemp from './components/cm-goods-temp'
  127. import cmInvicePopup from './components/cm-invice-popup'
  128. import cmFreightPopup from './components/cm-freight-popup'
  129. import cmCouponPopup from './components/cm-coupon-popup'
  130. import cmCouponChang from './components/cm-coupon-chang'
  131. import cmClubVisible from './components/cm-club-visible'
  132. import cmRegulaPopup from './components/cm-regula-popup'
  133. import cmCouponTips from './components/cm-coupon-tips'
  134. import conMixins from './mixins/conMixins.js'
  135. export default {
  136. mixins: [conMixins],
  137. components: {
  138. cmAddressTemp,
  139. cmGoodsTemp,
  140. cmInvicePopup,
  141. cmFreightPopup,
  142. cmCouponPopup,
  143. cmCouponChang,
  144. cmClubVisible,
  145. cmRegulaPopup,
  146. cmCouponTips
  147. },
  148. data() {
  149. return {
  150. isSubLoading: false,
  151. modalButton: [
  152. {
  153. text: '再想一想',
  154. type: 'gray',
  155. plain: true //是否空心
  156. },
  157. {
  158. text: '继续提交',
  159. customStyle: {
  160. color: '#fff',
  161. bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)'
  162. },
  163. plain: false
  164. }
  165. ],
  166. contentModalText: '', //操作文字提示语句
  167. modal: false,
  168. showModalstauts: 1,
  169. isIphoneX: this.$store.state.isIphoneX,
  170. confirmParam: {
  171. // 提交订单参数
  172. cartType: 3, // 购买类型:(1自主下单, 3协销下单)
  173. orderMiniType: 0, // 订单提交状态 0初始提交 1 继续提交
  174. orderSource: 6, // 订单来源 1WWW 6小程序[采美,星范]
  175. addressId: 0, // 收货地址Id
  176. clubCouponId: 0, // 关联优惠券Id
  177. clubId: 0, // 机构Id
  178. orderInfo: [], // 订单商品数据
  179. orderInvoice: { type: 0 }, // 订单发票信息
  180. orderSeen: 1, // 订单对机构可见度 1可见 2不可见
  181. payInfo: {// 订单金额数据
  182. orderShouldPayFee: 0, // 订单最终支付金额
  183. balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
  184. clauseId: 0, // 条款Id
  185. postage: 0, // 运费金额
  186. postageFlag: 0, // 运费类型
  187. userBeans: 0, // 抵扣采美豆数量
  188. rebateFee: 0, // 返佣服务费
  189. rebateFlag: 0 // 是否返佣订单
  190. },
  191. unionId: uni.getStorageSync('unionId') // 用户unionId
  192. },
  193. rebateFee: '',
  194. rebateFeeText: '否',
  195. confirmType: 1,
  196. submitState: '', // 提交状态
  197. isRequest: false, // 是否加载完成渲染子组件
  198. isFreight: false, // 是否加载完成渲染子组件
  199. isAddress: false, // 是否加载完成地址
  200. isExchangePopup: false, // 控制兑换优惠券弹窗
  201. isfreightTip: false, // 控制邮费弹窗
  202. ischecked: false, // 是否勾选余额
  203. addressData: {}, // 初始化地址信息
  204. goodsData: [], // 初始化商品信息
  205. couponList: [], // 初始化优惠券信息
  206. invoiceData: { type: 0 }, // 初始化发票信息
  207. orderInfo: [], // 提交的商品信息
  208. payInfo: {}, // 订单信息
  209. rechargeGoods: false,
  210. clauseList: [],
  211. seconDepositFlg: true,
  212. rebatecheck: false,
  213. isCouponShow: false, // 是否显示可选优惠券
  214. secondflag: true,
  215. isCouponModel: false, // 兑换优惠券成功提示
  216. ExchangeCouponData: {} // 兑换优惠券信息
  217. }
  218. },
  219. onLoad(option) {
  220. //商品数据
  221. this.initStorage(option)
  222. },
  223. filters: {
  224. NumFormat(value) {
  225. //处理金额
  226. return Number(value).toFixed(2)
  227. }
  228. },
  229. methods: {
  230. async initStorage(option) {
  231. const data = JSON.parse(option.data)
  232. const clubInfo = await this.$api.getComStorage('orderUserInfo')
  233. const userInfo = await this.$api.getStorage()
  234. this.handleComType = option.type*1
  235. this.productParam.clubId = this.cartParam.clubId = this.confirmParam.clubId = clubInfo.clubId
  236. this.productParam.serviceProviderId = userInfo.serviceProviderId
  237. this.cartParam.serviceProviderId = userInfo.serviceProviderId
  238. this.confirmParam.serviceProviderId = userInfo.serviceProviderId
  239. if (option.type == '1') {
  240. this.confirmType = 1
  241. this.productParam.productCount = data.data.productCount
  242. this.productParam.productId = data.data.productIds
  243. this.getAddressData(clubInfo.userId,1)
  244. } else {
  245. this.confirmType = 2
  246. this.cartParam.skuIds = data.data.skuIds
  247. this.getAddressData(clubInfo.userId,2)
  248. }
  249. },
  250. //协销购物车跳转确认订单初始化信息
  251. async getInitCrearOrder() {
  252. try{
  253. const res = await this.SellerService.SellerSettlement(this.cartParam)
  254. const data = res.data
  255. this.goodsData = data.list.map((el)=>{
  256. el.handlePostageFlag = el.postageFlag
  257. return el
  258. });
  259. this.userMoney = data.userMoney
  260. this.couponList = data.couponList
  261. this.reducedPrice = data.reducedPrice
  262. this.totalCount = data.totalCount
  263. this.allPrice = data.totalPrice
  264. this.rechargeGoods = data.includeRecharge
  265. this.clauseList = data.clauseList
  266. this.isCouponShow = true
  267. if (this.couponList.length > 0) {
  268. this.couponAmount = data.couponList[0].couponAmount
  269. this.confirmParam.clubCouponId = data.couponList[0].clubCouponId
  270. }
  271. this.orderShouldPayFee = this.allPrice - this.couponAmount
  272. this.isRequest = true
  273. }catch(error){
  274. console.log('获取订单信息异常')
  275. }
  276. },
  277. //二手下单初始化查询
  278. async getInitProdcutCrearOrder() {
  279. try{
  280. this.seconDepositFlg = false
  281. const res = await this.SellerService.GetSettlementBySencondProduct(this.productParam)
  282. const data = res.data
  283. this.goodsData = data.list.map((el)=>{
  284. el.handlePostageFlag = el.postageFlag
  285. return el
  286. });
  287. this.userMoney = data.userMoney
  288. this.totalCount = data.totalCount
  289. this.allPrice = data.totalPrice
  290. this.orderShouldPayFee = this.allPrice
  291. this.isCouponShow = false
  292. this.secondflag = false
  293. this.isRequest = true
  294. }catch(error){
  295. console.log('获取订单信息异常')
  296. }
  297. },
  298. //获取地址信息
  299. async getAddressData(userId,type) {
  300. try{
  301. const params = {pageNum: 1,pageSize: 1,userId: userId }
  302. const res = await this.UserService.QueryAddressList(params)
  303. const data = res.data
  304. if (data.list && data.list.length > 0) {
  305. this.addressData = data.list[0]
  306. this.confirmParam.addressId = this.addressData.addressId
  307. this.cartParam.townId = this.addressData.townId
  308. this.productParam.townId = this.addressData.townId
  309. if(type === 1) {//立即都买提交
  310. this.getInitProdcutCrearOrder()
  311. }
  312. if(type === 2) {//购物车提交
  313. this.getInitCrearOrder()
  314. }
  315. }
  316. }catch(error){
  317. console.log('获取订单地址异常')
  318. }
  319. },
  320. handChangeInputGoodsList(data) {
  321. //对应供应商的留言信息
  322. this.goodsData = data
  323. },
  324. handleChoiceaInvoiceData(data) {
  325. //获取发票信息
  326. this.confirmParam.orderInvoice = data
  327. },
  328. handleClauseData(clauseId) {
  329. // 条款Id
  330. this.confirmParam.payInfo.clauseId = parseInt(clauseId)
  331. },
  332. handleChoiceaCouponData(data) {
  333. // 勾选使用优惠券
  334. console.log('优惠券信息', data)
  335. this.couponAmount = data.couponAmount
  336. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  337. this.confirmParam.clubCouponId = data.clubCouponId
  338. this.attributePallPrice()
  339. },
  340. handleClubVisibleData(data) {
  341. // 订单对机构是否可见
  342. console.log('对机构是否可见', data)
  343. this.confirmParam.orderSeen = Number(data)
  344. },
  345. orderSubmitMit() {
  346. //提交订单
  347. if (this.confirmParam.addressId == '') {
  348. this.$util.msg('请先添加收货地址~', 2000)
  349. return
  350. }
  351. this.SellerCreateOrderSubmit()
  352. // if (this.confirmParam.payInfo.rebateFlag === 2) {
  353. // if (this.rebateFee == 0) {
  354. // this.$util.msg('请输入返佣服务费', 2000)
  355. // return
  356. // }
  357. // this.confirmParam.payInfo.rebateFee = Number(this.rebateFee).toFixed(2)
  358. // }
  359. // this.modal = true
  360. // this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
  361. },
  362. SellerCreateOrderSubmit() {
  363. //提交订单
  364. if (this.isSubLoading) {
  365. return
  366. }
  367. this.confirmParam.orderInfo = this.goodsData.map(el => {
  368. let productInfo = []
  369. el.cartList.forEach(pros => {
  370. productInfo.push({
  371. skuId: pros.skuId,
  372. productNum: pros.number,
  373. presentNum: 0,
  374. productType: pros.giftType
  375. })
  376. })
  377. return {
  378. splitCode: el.splitCode,
  379. shopId: el.shopId,
  380. note: el.note ? el.note : '',
  381. postage: parseInt(el.postage).toFixed(2),
  382. postageFlag: parseInt(el.handlePostageFlag),
  383. isColdChina: el.isColdChina ? 1 : 0,
  384. productInfo: productInfo
  385. }
  386. })
  387. this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
  388. this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
  389. this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
  390. this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
  391. this.isSubLoading = true
  392. this.hanldeOrderSubmit(this.confirmParam)
  393. },
  394. // 提交订单
  395. async hanldeOrderSubmit(params) {
  396. try{
  397. const res = await this.SellerService.SellerCreateOrderSubmit(params)
  398. const data = res.data
  399. if (data.code === 1) {
  400. this.$util.msg('支付成功', 2000, true, 'success')
  401. setTimeout(() => {
  402. this.isSubLoading = false
  403. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  404. }, 2000)
  405. } else {
  406. this.$util.msg('订单提交成功', 2000, true, 'success')
  407. setTimeout(() => {
  408. this.isSubLoading = false
  409. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  410. }, 2000)
  411. }
  412. }catch(error){
  413. this.isSubLoading = false
  414. this.handleError(error)
  415. }
  416. },
  417. handleError(data) {
  418. // 提交订单异常处理
  419. this.formatConfirmParam()
  420. const buttonMap = {
  421. 1: {
  422. contentModalText:
  423. '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。',
  424. modalButton: [
  425. { text: '取消', type: 'gray', plain: true },
  426. {
  427. text: '继续提交',
  428. customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)' },
  429. plain: false
  430. }
  431. ]
  432. }
  433. }
  434. if (data.code === -6) {
  435. // 非医美机构下三类商品订单
  436. this.modal = true
  437. this.showModalstauts = 2
  438. this.contentModalText = buttonMap[1].contentModalText
  439. this.modalButton = buttonMap[1].modalButton
  440. } else {
  441. this.$util.msg(data.msg, 3000)
  442. }
  443. },
  444. formatConfirmParam() {
  445. // 还原提交订单参数格式
  446. this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
  447. this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
  448. this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
  449. },
  450. handleRebateFlag() {
  451. // 普通订单返佣
  452. let self = this
  453. uni.showActionSheet({
  454. itemList: ['返佣订单', '普通订单,存在返佣服务费', '否'],
  455. success: e => {
  456. switch (e.tapIndex) {
  457. case 0:
  458. self.confirmParam.payInfo.rebateFlag = 1
  459. self.rebateFeeText = '返佣订单'
  460. break
  461. case 1:
  462. self.confirmParam.payInfo.rebateFlag = 2
  463. self.rebateFeeText = '普通订单,存在返佣服务费'
  464. break
  465. case 2:
  466. self.confirmParam.payInfo.rebateFlag = 0
  467. self.rebateFeeText = '否'
  468. break
  469. }
  470. }
  471. })
  472. if (this.confirmParam.payInfo.rebateFlag === 1) {
  473. this.confirmParam.payInfo.balancePayFlag = 0
  474. this.couponAmount = 0
  475. this.confirmParam.clubCouponId = 0
  476. this.confirmParam.orderSeen = 2
  477. this.$refs.clubVisible.orderVisibleText = '不可见'
  478. this.$refs.clubVisible.current = 1
  479. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  480. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  481. this.$refs.coupon.coupon.couponAmount = 0
  482. this.$refs.freight.infoData(this.freightData)
  483. this.$refs.freight.freightData = this.freightData
  484. this.handleFreightData = this.freightData
  485. } else {
  486. this.confirmParam.orderSeen = 1
  487. this.$refs.clubVisible.orderVisibleText = '可见'
  488. if (this.couponList.length > 0) {
  489. this.confirmParam.clubCouponId = this.couponList[0].clubCouponId
  490. this.$refs.coupon.coupon.couponAmount = this.couponAmount = this.couponList[0].couponAmount
  491. }
  492. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  493. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  494. }
  495. },
  496. handleClick(e) {
  497. //确认提交
  498. if (e.index == 1) {
  499. if (this.showModalstauts == 2) {
  500. this.confirmParam.orderMiniType = 2
  501. this.SellerCreateOrderSubmit()
  502. } else {
  503. this.SellerCreateOrderSubmit()
  504. }
  505. }
  506. this.confirmParam.orderMiniType = 0
  507. this.modal = false
  508. },
  509. handleSecondFlag() {
  510. // 二手订单勾选返佣
  511. this.rebatecheck = !this.rebatecheck
  512. if (this.rebatecheck) {
  513. this.ischecked = false
  514. this.confirmParam.payInfo.rebateFlag = 1
  515. this.confirmParam.payInfo.balancePayFlag = 0
  516. this.confirmParam.clubCouponId = 0
  517. this.confirmParam.orderSeen = 2
  518. this.$refs.clubVisible.orderVisibleText = '不可见'
  519. this.$refs.clubVisible.current = 1
  520. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  521. this.$refs.freight.infoData(this.freightData)
  522. this.$refs.freight.freightData = this.freightData
  523. this.handleFreightData = this.freightData
  524. } else {
  525. this.confirmParam.orderSeen = 1
  526. this.$refs.clubVisible.orderVisibleText = '可见'
  527. this.confirmParam.payInfo.rebateFlag = 0
  528. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  529. }
  530. },
  531. handFreightAlertShow() {
  532. //显示邮费弹窗
  533. this.isfreightTip = true
  534. },
  535. handleClickCancel() {
  536. // 关闭优惠券弹窗
  537. this.isCouponModel = false
  538. this.getInitCrearOrder()
  539. },
  540. hideFreight() {
  541. //关闭邮费弹窗
  542. this.isfreightTip = false
  543. },
  544. hideMobel() {
  545. this.modal = false
  546. }
  547. },
  548. onShow() {
  549. let pages = getCurrentPages()
  550. let currPage = pages[pages.length - 1]
  551. if (currPage.data.select == 'select') {
  552. this.isAddress = true
  553. let SelectData = uni.getStorageSync('selectAddress')
  554. this.confirmParam.addressId = SelectData.addressId
  555. this.cartParam.townId = selectData.townId
  556. this.productParam.townId = selectData.townId
  557. this.addressData = SelectData
  558. if(this.handleComType === 1) {//立即都买提交
  559. this.getInitProdcutCrearOrder()
  560. }
  561. if(this.handleComType === 2) {//购物车提交
  562. this.getInitCrearOrder()
  563. }
  564. }
  565. }
  566. }
  567. </script>
  568. <style lang="scss">
  569. page {
  570. height: auto;
  571. background: #f7f7f7;
  572. }
  573. .btn-hover {
  574. background: #ffffff;
  575. }
  576. .animation {
  577. /* transition: transform 0.3s ease;*/
  578. transition-property: transform;
  579. transition-duration: 0.3s;
  580. transition-timing-function: ease;
  581. }
  582. .invoice-freight {
  583. width: 702rpx;
  584. padding: 0 24rpx;
  585. height: 86rpx;
  586. line-height: 86rpx;
  587. font-size: $font-size-28;
  588. color: $text-color;
  589. background: #ffffff;
  590. float: left;
  591. font-weight: bold;
  592. .freight-left {
  593. float: left;
  594. .icon-yunfeishuoming {
  595. height: 100%;
  596. padding: 0 15rpx;
  597. color: $color-system;
  598. font-weight: normal;
  599. }
  600. }
  601. .freight-right {
  602. float: right;
  603. color: #2a81ff;
  604. }
  605. }
  606. .invoice-balance {
  607. width: 702rpx;
  608. height: auto;
  609. padding: 0 24rpx;
  610. background: #ffffff;
  611. float: left;
  612. margin-top: 24rpx;
  613. margin-bottom: 24rpx;
  614. .balabce-t {
  615. width: 100%;
  616. height: 86rpx;
  617. line-height: 86rpx;
  618. font-size: $font-size-28;
  619. color: $text-color;
  620. float: left;
  621. .balabce-t-le {
  622. float: left;
  623. font-weight: bold;
  624. }
  625. .balabce-t-ri {
  626. float: right;
  627. display: flex;
  628. align-items: center;
  629. .money {
  630. display: flex;
  631. float: left;
  632. }
  633. .checkbox-box {
  634. display: flex;
  635. width: 60rpx;
  636. float: left;
  637. height: 100%;
  638. font-size: $font-size-24;
  639. .checkbox {
  640. width: 40rpx;
  641. text-align: right;
  642. box-sizing: border-box;
  643. text-align: center;
  644. text-decoration: none;
  645. border-radius: 0;
  646. -webkit-tap-highlight-color: transparent;
  647. overflow: hidden;
  648. color: $color-system;
  649. padding: 5rpx;
  650. }
  651. }
  652. }
  653. }
  654. .balabce-b {
  655. width: 100%;
  656. float: left;
  657. overflow: hidden;
  658. .balabce-b-text {
  659. width: 100%;
  660. line-height: 58rpx;
  661. font-size: $font-size-24;
  662. color: #ff2a2a;
  663. text-align: right;
  664. float: right;
  665. }
  666. &.balabce-b--hide {
  667. padding: 0 0;
  668. height: 0px;
  669. line-height: 0px;
  670. }
  671. }
  672. }
  673. .footer {
  674. position: fixed;
  675. left: 0;
  676. bottom: 0;
  677. display: flex;
  678. align-items: center;
  679. width: 100%;
  680. height: 110rpx;
  681. line-height: 110rpx;
  682. justify-content: space-between;
  683. font-size: $font-size-28;
  684. background-color: #ffffff;
  685. z-index: 990;
  686. color: $text-color;
  687. .footer-le {
  688. width: 570rpx;
  689. height: 100%;
  690. float: left;
  691. }
  692. .footer-count {
  693. float: left;
  694. padding-left: 24rpx;
  695. width: 190rpx;
  696. box-sizing: border-box;
  697. font-size: $font-size-26;
  698. }
  699. .footer-price {
  700. width: 370rpx;
  701. float: right;
  702. text-align: right;
  703. color: $text-color;
  704. padding: 10rpx 20rpx 10rpx 0;
  705. box-sizing: border-box;
  706. .sum-none {
  707. width: 100%;
  708. height: 45rpx;
  709. line-height: 45rpx;
  710. color: $text-color;
  711. float: left;
  712. text-align: right;
  713. .money {
  714. font-size: $font-size-26;
  715. color: #999999;
  716. text-decoration: line-through;
  717. }
  718. .money-sign {
  719. font-size: $font-size-26;
  720. color: #999999;
  721. text-decoration: line-through;
  722. }
  723. .money-reduced {
  724. margin-left: 10rpx;
  725. font-size: $font-size-26;
  726. color: $color-system;
  727. }
  728. }
  729. .sum {
  730. width: 100%;
  731. height: 45rpx;
  732. line-height: 45rpx;
  733. float: left;
  734. &.none {
  735. height: 90rpx;
  736. line-height: 90rpx;
  737. }
  738. .price {
  739. font-size: $font-size-32;
  740. color: #ff2a2a;
  741. }
  742. }
  743. }
  744. .footer-submit {
  745. display: flex;
  746. align-items: center;
  747. justify-content: center;
  748. width: 180rpx;
  749. height: 100%;
  750. box-sizing: border-box;
  751. padding: 15rpx 5rpx;
  752. .btn {
  753. width: 100%;
  754. height: 100%;
  755. color: #ffffff;
  756. background: linear-gradient(90deg, #ff9300 0%, #ff5b00 100%);
  757. font-size: $font-size-26;
  758. text-align: center;
  759. line-height: 80rpx;
  760. border-radius: 40rpx;
  761. &.disabled {
  762. background: #e4e8eb;
  763. color: #999999;
  764. }
  765. }
  766. }
  767. }
  768. .order-return {
  769. width: 100%;
  770. height: auto;
  771. box-sizing: border-box;
  772. padding: 0 24rpx;
  773. background: #ffffff;
  774. float: left;
  775. margin: 24rpx 0;
  776. .order-return-main {
  777. width: 100%;
  778. height: 86rpx;
  779. line-height: 86rpx;
  780. .label {
  781. float: left;
  782. font-weight: bold;
  783. color: #333333;
  784. font-size: $font-size-28;
  785. }
  786. .label-right {
  787. float: right;
  788. color: #2a81ff;
  789. .text-l {
  790. font-size: 28rpx;
  791. font-weight: bold;
  792. margin-right: 20rpx;
  793. }
  794. .icon-xiayibu {
  795. line-height: 88rpx;
  796. color: #999999;
  797. font-weight: normal;
  798. }
  799. }
  800. }
  801. .order-return-input {
  802. width: 100%;
  803. height: 86rpx;
  804. padding-bottom: 20rpx;
  805. box-sizing: border-box;
  806. .input {
  807. width: 100%;
  808. height: 66rpx;
  809. font-size: $font-size-26;
  810. border: 1px solid #e1e1e1;
  811. line-height: 66rpx;
  812. color: #333333;
  813. border-radius: 4rpx;
  814. box-sizing: border-box;
  815. padding: 0 20rpx;
  816. }
  817. }
  818. }
  819. .Rebate {
  820. width: 702rpx;
  821. height: auto;
  822. padding: 0 24rpx;
  823. background: #ffffff;
  824. float: left;
  825. margin-bottom: 24rpx;
  826. margin-top: 24rpx;
  827. line-height: 86rpx;
  828. .rebate-title {
  829. float: left;
  830. font-weight: bold;
  831. color: #333333;
  832. font-size: $font-size-28;
  833. }
  834. .iconfont {
  835. float: right;
  836. color: #b2b2b2;
  837. font-size: 40rpx;
  838. &.icon-yixuanze {
  839. color: $color-system;
  840. }
  841. }
  842. }
  843. .coupon-content-model {
  844. width: 100%;
  845. height: 100%;
  846. background: rgba(0, 0, 0, 0.5);
  847. position: fixed;
  848. top: 0;
  849. left: 0;
  850. z-index: 8888;
  851. transition: all 0.4s;
  852. .coupon-alert-content {
  853. width: 600rpx;
  854. height: 612rpx;
  855. position: absolute;
  856. top: 0;
  857. left: 0;
  858. bottom: 0;
  859. right: 0;
  860. margin: auto;
  861. box-sizing: border-box;
  862. padding-top: 92rpx;
  863. .coupon {
  864. width: 600rpx;
  865. height: 522rpx;
  866. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  867. background-size: cover;
  868. box-sizing: border-box;
  869. padding: 230rpx 40rpx 0 40rpx;
  870. .coupon-list {
  871. width: 100%;
  872. height: 147rpx;
  873. margin-bottom: 32rpx;
  874. box-sizing: border-box;
  875. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  876. background-size: cover;
  877. position: relative;
  878. .list-cell-tags {
  879. display: inline-block;
  880. padding: 0 10rpx;
  881. height: 32rpx;
  882. line-height: 32rpx;
  883. background-color: #f94b4b;
  884. color: #ffffff;
  885. font-size: 18rpx;
  886. border-radius: 16rpx 0 16rpx 0;
  887. text-align: center;
  888. position: absolute;
  889. top: 0;
  890. left: 0;
  891. }
  892. .list-cell-le {
  893. width: 154rpx;
  894. height: 100%;
  895. box-sizing: border-box;
  896. padding: 30rpx 0;
  897. float: left;
  898. .coupon-maxMoney {
  899. width: 100%;
  900. height: 54rpx;
  901. line-height: 54rpx;
  902. font-size: 42rpx;
  903. color: #f94b4b;
  904. text-align: center;
  905. margin-top: 10rpx;
  906. .small {
  907. font-size: $font-size-20;
  908. }
  909. }
  910. .coupon-minMoney {
  911. width: 100%;
  912. height: 28rpx;
  913. float: left;
  914. box-sizing: border-box;
  915. padding-left: 24rpx;
  916. .txt {
  917. display: block;
  918. height: 28rpx;
  919. line-height: 28rpx;
  920. font-size: 16rpx;
  921. color: #f94b4b;
  922. text-align: center;
  923. padding: 0 5rpx;
  924. background-color: #fff1eb;
  925. border-radius: 4rpx;
  926. float: left;
  927. }
  928. }
  929. }
  930. .list-cell-ri {
  931. width: 366rpx;
  932. height: 100%;
  933. box-sizing: border-box;
  934. padding: 30rpx 20rpx;
  935. float: left;
  936. .list-cell-top {
  937. width: 100%;
  938. height: 64rpx;
  939. line-height: 64rpx;
  940. font-size: $font-size-26;
  941. color: #333333;
  942. float: left;
  943. text-overflow: ellipsis;
  944. display: -webkit-box;
  945. word-break: break-all;
  946. -webkit-box-orient: vertical;
  947. -webkit-line-clamp: 1;
  948. overflow: hidden;
  949. }
  950. .list-cell-time {
  951. width: 100%;
  952. height: 28rpx;
  953. line-height: 28rpx;
  954. text-align: left;
  955. font-size: $font-size-20;
  956. color: #999999;
  957. }
  958. }
  959. }
  960. .coupon-btn {
  961. width: 100%;
  962. height: 78rpx;
  963. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  964. background-size: cover;
  965. line-height: 78rpx;
  966. text-align: center;
  967. color: #ffffff;
  968. font-size: $font-size-36;
  969. }
  970. }
  971. }
  972. }
  973. </style>