create-order.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. <template>
  2. <view class="container order clearfix" :style="{ paddingBottom: isIphoneX ? '190rpx' : '134rpx' }">
  3. <!-- 地址选择 -->
  4. <cm-address-temp ref="choiceAddress" v-if="isRequest" :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="isRequest && !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. // 订单金额数据
  183. orderShouldPayFee: 0, // 订单最终支付金额
  184. balancePayFlag: 0, // 勾选余额的状态(1使用,0不使用)
  185. clauseId: 0, // 条款Id
  186. postage: 0, // 运费金额
  187. postageFlag: 0, // 运费类型
  188. userBeans: 0, // 抵扣采美豆数量
  189. rebateFee: 0, // 返佣服务费
  190. rebateFlag: 0 // 是否返佣订单
  191. },
  192. unionId: uni.getStorageSync('unionId') // 用户unionId
  193. },
  194. rebateFee: '',
  195. rebateFeeText: '否',
  196. confirmType: 1,
  197. submitState: '', // 提交状态
  198. isRequest: false, // 是否加载完成渲染子组件
  199. isFreight: 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.cityId = this.addressData.cityId
  308. this.productParam.cityId = this.addressData.cityId
  309. }
  310. if (type === 1) {
  311. //立即都买提交
  312. this.getInitProdcutCrearOrder()
  313. }
  314. if (type === 2) {
  315. //购物车提交
  316. this.getInitCrearOrder()
  317. }
  318. } catch (error) {
  319. console.log('获取订单地址异常')
  320. }
  321. },
  322. handChangeInputGoodsList(data) {
  323. //对应供应商的留言信息
  324. this.goodsData = data
  325. },
  326. handleChoiceaInvoiceData(data) {
  327. //获取发票信息
  328. this.confirmParam.orderInvoice = data
  329. },
  330. handleClauseData(clauseId) {
  331. // 条款Id
  332. this.confirmParam.payInfo.clauseId = parseInt(clauseId)
  333. },
  334. handleChoiceaCouponData(data) {
  335. // 勾选使用优惠券
  336. console.log('优惠券信息', data)
  337. this.couponAmount = data.couponAmount
  338. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  339. this.confirmParam.clubCouponId = data.clubCouponId
  340. this.attributePallPrice()
  341. },
  342. handleClubVisibleData(data) {
  343. // 订单对机构是否可见
  344. console.log('对机构是否可见', data)
  345. this.confirmParam.orderSeen = Number(data)
  346. },
  347. orderSubmitMit() {
  348. //提交订单
  349. if (this.confirmParam.addressId == '') {
  350. this.$util.msg('请先添加收货地址~', 2000)
  351. return
  352. }
  353. this.SellerCreateOrderSubmit()
  354. // if (this.confirmParam.payInfo.rebateFlag === 2) {
  355. // if (this.rebateFee == 0) {
  356. // this.$util.msg('请输入返佣服务费', 2000)
  357. // return
  358. // }
  359. // this.confirmParam.payInfo.rebateFee = Number(this.rebateFee).toFixed(2)
  360. // }
  361. // this.modal = true
  362. // this.contentModalText = '请仔细确认订单是否为返佣订单后再提交订单'
  363. },
  364. SellerCreateOrderSubmit() {
  365. //提交订单
  366. if (this.isSubLoading) {
  367. return
  368. }
  369. this.confirmParam.orderInfo = this.hanldeProcessing()
  370. this.confirmParam.payInfo.orderShouldPayFee = this.orderShouldPayFee.toFixed(2)
  371. this.confirmParam.payInfo = JSON.stringify(this.confirmParam.payInfo)
  372. this.confirmParam.orderInfo = JSON.stringify(this.confirmParam.orderInfo)
  373. this.confirmParam.orderInvoice = JSON.stringify(this.confirmParam.orderInvoice)
  374. this.isSubLoading = true
  375. this.hanldeOrderSubmit(this.confirmParam)
  376. },
  377. // 处理数据格式
  378. hanldeProcessing() {
  379. return this.goodsData.map(el => {
  380. let productInfo = []
  381. el.cartList.forEach(pros => {
  382. productInfo.push({
  383. skuId: pros.skuId,
  384. productNum: pros.number,
  385. presentNum: 0,
  386. productType: pros.giftType
  387. })
  388. })
  389. return {
  390. splitCode: el.splitCode,
  391. shopId: el.shopId,
  392. note: el.note ? el.note : '',
  393. postage: el.isColdChina
  394. ? parseInt(el.postage + el.coldChain).toFixed(2)
  395. : parseInt(el.postage).toFixed(2),
  396. postageFlag: parseInt(el.handlePostageFlag),
  397. isColdChina: el.isColdChina ? 1 : 0,
  398. productInfo: productInfo
  399. }
  400. })
  401. },
  402. // 提交订单
  403. async hanldeOrderSubmit(params) {
  404. try {
  405. const res = await this.SellerService.SellerCreateOrderSubmit(params)
  406. const data = res.data
  407. if (data.code === 1) {
  408. this.$util.msg('支付成功', 2000, true, 'success')
  409. setTimeout(() => {
  410. this.isSubLoading = false
  411. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  412. }, 2000)
  413. } else {
  414. this.$util.msg('订单提交成功', 2000, true, 'success')
  415. setTimeout(() => {
  416. this.isSubLoading = false
  417. this.$api.redirectTo('/pages/seller/order/order-list?listType=0')
  418. }, 2000)
  419. }
  420. } catch (error) {
  421. this.isSubLoading = false
  422. this.handleError(error)
  423. }
  424. },
  425. handleError(data) {
  426. // 提交订单异常处理
  427. this.formatConfirmParam()
  428. const buttonMap = {
  429. 1: {
  430. contentModalText:
  431. '订单内存在械字号三类商品,需要拥有医疗执业许可证的医美机构才能购买。建议升级医美机构后再下单,否则会导致订单退款或影响发货。',
  432. modalButton: [
  433. { text: '取消', type: 'gray', plain: true },
  434. {
  435. text: '继续提交',
  436. customStyle: { color: '#fff', bgColor: 'linear-gradient(90deg, #F28F31 0%, #FF5B00 100%)' },
  437. plain: false
  438. }
  439. ]
  440. }
  441. }
  442. if (data.code === -6) {
  443. // 非医美机构下三类商品订单
  444. this.modal = true
  445. this.showModalstauts = 2
  446. this.contentModalText = buttonMap[1].contentModalText
  447. this.modalButton = buttonMap[1].modalButton
  448. } else {
  449. this.$util.msg(data.msg, 3000)
  450. }
  451. },
  452. formatConfirmParam() {
  453. // 还原提交订单参数格式
  454. this.confirmParam.payInfo = JSON.parse(this.confirmParam.payInfo)
  455. this.confirmParam.orderInfo = JSON.parse(this.confirmParam.orderInfo)
  456. this.confirmParam.orderInvoice = JSON.parse(this.confirmParam.orderInvoice)
  457. },
  458. handleRebateFlag() {
  459. // 普通订单返佣
  460. let self = this
  461. uni.showActionSheet({
  462. itemList: ['返佣订单', '普通订单,存在返佣服务费', '否'],
  463. success: e => {
  464. switch (e.tapIndex) {
  465. case 0:
  466. self.confirmParam.payInfo.rebateFlag = 1
  467. self.rebateFeeText = '返佣订单'
  468. break
  469. case 1:
  470. self.confirmParam.payInfo.rebateFlag = 2
  471. self.rebateFeeText = '普通订单,存在返佣服务费'
  472. break
  473. case 2:
  474. self.confirmParam.payInfo.rebateFlag = 0
  475. self.rebateFeeText = '否'
  476. break
  477. }
  478. }
  479. })
  480. if (this.confirmParam.payInfo.rebateFlag === 1) {
  481. this.confirmParam.payInfo.balancePayFlag = 0
  482. this.couponAmount = 0
  483. this.confirmParam.clubCouponId = 0
  484. this.confirmParam.orderSeen = 2
  485. this.$refs.clubVisible.orderVisibleText = '不可见'
  486. this.$refs.clubVisible.current = 1
  487. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  488. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  489. this.$refs.coupon.coupon.couponAmount = 0
  490. this.$refs.freight.infoData(this.freightData)
  491. this.$refs.freight.freightData = this.freightData
  492. this.handleFreightData = this.freightData
  493. } else {
  494. this.confirmParam.orderSeen = 1
  495. this.$refs.clubVisible.orderVisibleText = '可见'
  496. if (this.couponList.length > 0) {
  497. this.confirmParam.clubCouponId = this.couponList[0].clubCouponId
  498. this.$refs.coupon.coupon.couponAmount = this.couponAmount = this.couponList[0].couponAmount
  499. }
  500. this.totalDiscountAmount = this.reducedPrice + this.couponAmount
  501. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage) - this.couponAmount
  502. }
  503. },
  504. handleClick(e) {
  505. //确认提交
  506. if (e.index == 1) {
  507. if (this.showModalstauts == 2) {
  508. this.confirmParam.orderMiniType = 2
  509. this.SellerCreateOrderSubmit()
  510. } else {
  511. this.SellerCreateOrderSubmit()
  512. }
  513. }
  514. this.confirmParam.orderMiniType = 0
  515. this.modal = false
  516. },
  517. handleSecondFlag() {
  518. // 二手订单勾选返佣
  519. this.rebatecheck = !this.rebatecheck
  520. if (this.rebatecheck) {
  521. this.ischecked = false
  522. this.confirmParam.payInfo.rebateFlag = 1
  523. this.confirmParam.payInfo.balancePayFlag = 0
  524. this.confirmParam.clubCouponId = 0
  525. this.confirmParam.orderSeen = 2
  526. this.$refs.clubVisible.orderVisibleText = '不可见'
  527. this.$refs.clubVisible.current = 1
  528. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  529. this.$refs.freight.infoData(this.freightData)
  530. this.$refs.freight.freightData = this.freightData
  531. this.handleFreightData = this.freightData
  532. } else {
  533. this.confirmParam.orderSeen = 1
  534. this.$refs.clubVisible.orderVisibleText = '可见'
  535. this.confirmParam.payInfo.rebateFlag = 0
  536. this.orderShouldPayFee = this.allPrice + parseInt(this.freightData.postage)
  537. }
  538. },
  539. handFreightAlertShow() {
  540. //显示邮费弹窗
  541. this.isfreightTip = true
  542. },
  543. handleClickCancel() {
  544. // 关闭优惠券弹窗
  545. this.isCouponModel = false
  546. this.getInitCrearOrder()
  547. },
  548. hideFreight() {
  549. //关闭邮费弹窗
  550. this.isfreightTip = false
  551. },
  552. hideMobel() {
  553. this.modal = false
  554. }
  555. },
  556. onShow() {
  557. let pages = getCurrentPages()
  558. let currPage = pages[pages.length - 1]
  559. if (currPage.data.select == 'select') {
  560. let address = uni.getStorageSync('selectAddress')
  561. this.confirmParam.addressId = address.addressId
  562. this.cartParam.cityId = address.cityId
  563. this.productParam.cityId = address.cityId
  564. this.addressData = address
  565. this.ischecked = false
  566. this.isRequest = false
  567. if (this.handleComType === 1) {
  568. //立即都买提交
  569. this.getInitProdcutCrearOrder()
  570. }
  571. if (this.handleComType === 2) {
  572. //购物车提交
  573. this.getInitCrearOrder()
  574. }
  575. }
  576. }
  577. }
  578. </script>
  579. <style lang="scss">
  580. page {
  581. height: auto;
  582. background: #f7f7f7;
  583. }
  584. .btn-hover {
  585. background: #ffffff;
  586. }
  587. .animation {
  588. /* transition: transform 0.3s ease;*/
  589. transition-property: transform;
  590. transition-duration: 0.3s;
  591. transition-timing-function: ease;
  592. }
  593. .invoice-freight {
  594. width: 702rpx;
  595. padding: 0 24rpx;
  596. height: 86rpx;
  597. line-height: 86rpx;
  598. font-size: $font-size-28;
  599. color: $text-color;
  600. background: #ffffff;
  601. float: left;
  602. font-weight: bold;
  603. .freight-left {
  604. float: left;
  605. .icon-yunfeishuoming {
  606. height: 100%;
  607. padding: 0 15rpx;
  608. color: $color-system;
  609. font-weight: normal;
  610. }
  611. }
  612. .freight-right {
  613. float: right;
  614. color: #2a81ff;
  615. }
  616. }
  617. .invoice-balance {
  618. width: 702rpx;
  619. height: auto;
  620. padding: 0 24rpx;
  621. background: #ffffff;
  622. float: left;
  623. margin-top: 24rpx;
  624. margin-bottom: 24rpx;
  625. .balabce-t {
  626. width: 100%;
  627. height: 86rpx;
  628. line-height: 86rpx;
  629. font-size: $font-size-28;
  630. color: $text-color;
  631. float: left;
  632. .balabce-t-le {
  633. float: left;
  634. font-weight: bold;
  635. }
  636. .balabce-t-ri {
  637. float: right;
  638. display: flex;
  639. align-items: center;
  640. .money {
  641. display: flex;
  642. float: left;
  643. }
  644. .checkbox-box {
  645. display: flex;
  646. width: 60rpx;
  647. float: left;
  648. height: 100%;
  649. font-size: $font-size-24;
  650. .checkbox {
  651. width: 40rpx;
  652. text-align: right;
  653. box-sizing: border-box;
  654. text-align: center;
  655. text-decoration: none;
  656. border-radius: 0;
  657. -webkit-tap-highlight-color: transparent;
  658. overflow: hidden;
  659. color: $color-system;
  660. padding: 5rpx;
  661. }
  662. }
  663. }
  664. }
  665. .balabce-b {
  666. width: 100%;
  667. float: left;
  668. overflow: hidden;
  669. .balabce-b-text {
  670. width: 100%;
  671. line-height: 58rpx;
  672. font-size: $font-size-24;
  673. color: #ff2a2a;
  674. text-align: right;
  675. float: right;
  676. }
  677. &.balabce-b--hide {
  678. padding: 0 0;
  679. height: 0px;
  680. line-height: 0px;
  681. }
  682. }
  683. }
  684. .footer {
  685. position: fixed;
  686. left: 0;
  687. bottom: 0;
  688. display: flex;
  689. align-items: center;
  690. width: 100%;
  691. height: 110rpx;
  692. line-height: 110rpx;
  693. justify-content: space-between;
  694. font-size: $font-size-28;
  695. background-color: #ffffff;
  696. z-index: 990;
  697. color: $text-color;
  698. .footer-le {
  699. width: 570rpx;
  700. height: 100%;
  701. float: left;
  702. }
  703. .footer-count {
  704. float: left;
  705. padding-left: 24rpx;
  706. width: 190rpx;
  707. box-sizing: border-box;
  708. font-size: $font-size-26;
  709. }
  710. .footer-price {
  711. width: 370rpx;
  712. float: right;
  713. text-align: right;
  714. color: $text-color;
  715. padding: 10rpx 20rpx 10rpx 0;
  716. box-sizing: border-box;
  717. .sum-none {
  718. width: 100%;
  719. height: 45rpx;
  720. line-height: 45rpx;
  721. color: $text-color;
  722. float: left;
  723. text-align: right;
  724. .money {
  725. font-size: $font-size-26;
  726. color: #999999;
  727. text-decoration: line-through;
  728. }
  729. .money-sign {
  730. font-size: $font-size-26;
  731. color: #999999;
  732. text-decoration: line-through;
  733. }
  734. .money-reduced {
  735. margin-left: 10rpx;
  736. font-size: $font-size-26;
  737. color: $color-system;
  738. }
  739. }
  740. .sum {
  741. width: 100%;
  742. height: 45rpx;
  743. line-height: 45rpx;
  744. float: left;
  745. &.none {
  746. height: 90rpx;
  747. line-height: 90rpx;
  748. }
  749. .price {
  750. font-size: $font-size-32;
  751. color: #ff2a2a;
  752. }
  753. }
  754. }
  755. .footer-submit {
  756. display: flex;
  757. align-items: center;
  758. justify-content: center;
  759. width: 180rpx;
  760. height: 100%;
  761. box-sizing: border-box;
  762. padding: 15rpx 5rpx;
  763. .btn {
  764. width: 100%;
  765. height: 100%;
  766. color: #ffffff;
  767. background: linear-gradient(90deg, #ff9300 0%, #ff5b00 100%);
  768. font-size: $font-size-26;
  769. text-align: center;
  770. line-height: 80rpx;
  771. border-radius: 40rpx;
  772. &.disabled {
  773. background: #e4e8eb;
  774. color: #999999;
  775. }
  776. }
  777. }
  778. }
  779. .order-return {
  780. width: 100%;
  781. height: auto;
  782. box-sizing: border-box;
  783. padding: 0 24rpx;
  784. background: #ffffff;
  785. float: left;
  786. margin: 24rpx 0;
  787. .order-return-main {
  788. width: 100%;
  789. height: 86rpx;
  790. line-height: 86rpx;
  791. .label {
  792. float: left;
  793. font-weight: bold;
  794. color: #333333;
  795. font-size: $font-size-28;
  796. }
  797. .label-right {
  798. float: right;
  799. color: #2a81ff;
  800. .text-l {
  801. font-size: 28rpx;
  802. font-weight: bold;
  803. margin-right: 20rpx;
  804. }
  805. .icon-xiayibu {
  806. line-height: 88rpx;
  807. color: #999999;
  808. font-weight: normal;
  809. }
  810. }
  811. }
  812. .order-return-input {
  813. width: 100%;
  814. height: 86rpx;
  815. padding-bottom: 20rpx;
  816. box-sizing: border-box;
  817. .input {
  818. width: 100%;
  819. height: 66rpx;
  820. font-size: $font-size-26;
  821. border: 1px solid #e1e1e1;
  822. line-height: 66rpx;
  823. color: #333333;
  824. border-radius: 4rpx;
  825. box-sizing: border-box;
  826. padding: 0 20rpx;
  827. }
  828. }
  829. }
  830. .Rebate {
  831. width: 702rpx;
  832. height: auto;
  833. padding: 0 24rpx;
  834. background: #ffffff;
  835. float: left;
  836. margin-bottom: 24rpx;
  837. margin-top: 24rpx;
  838. line-height: 86rpx;
  839. .rebate-title {
  840. float: left;
  841. font-weight: bold;
  842. color: #333333;
  843. font-size: $font-size-28;
  844. }
  845. .iconfont {
  846. float: right;
  847. color: #b2b2b2;
  848. font-size: 40rpx;
  849. &.icon-yixuanze {
  850. color: $color-system;
  851. }
  852. }
  853. }
  854. .coupon-content-model {
  855. width: 100%;
  856. height: 100%;
  857. background: rgba(0, 0, 0, 0.5);
  858. position: fixed;
  859. top: 0;
  860. left: 0;
  861. z-index: 8888;
  862. transition: all 0.4s;
  863. .coupon-alert-content {
  864. width: 600rpx;
  865. height: 612rpx;
  866. position: absolute;
  867. top: 0;
  868. left: 0;
  869. bottom: 0;
  870. right: 0;
  871. margin: auto;
  872. box-sizing: border-box;
  873. padding-top: 92rpx;
  874. .coupon {
  875. width: 600rpx;
  876. height: 522rpx;
  877. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbg@2x.png);
  878. background-size: cover;
  879. box-sizing: border-box;
  880. padding: 230rpx 40rpx 0 40rpx;
  881. .coupon-list {
  882. width: 100%;
  883. height: 147rpx;
  884. margin-bottom: 32rpx;
  885. box-sizing: border-box;
  886. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-bg@2x.png);
  887. background-size: cover;
  888. position: relative;
  889. .list-cell-tags {
  890. display: inline-block;
  891. padding: 0 10rpx;
  892. height: 32rpx;
  893. line-height: 32rpx;
  894. background-color: #f94b4b;
  895. color: #ffffff;
  896. font-size: 18rpx;
  897. border-radius: 16rpx 0 16rpx 0;
  898. text-align: center;
  899. position: absolute;
  900. top: 0;
  901. left: 0;
  902. }
  903. .list-cell-le {
  904. width: 154rpx;
  905. height: 100%;
  906. box-sizing: border-box;
  907. padding: 30rpx 0;
  908. float: left;
  909. .coupon-maxMoney {
  910. width: 100%;
  911. height: 54rpx;
  912. line-height: 54rpx;
  913. font-size: 42rpx;
  914. color: #f94b4b;
  915. text-align: center;
  916. margin-top: 10rpx;
  917. .small {
  918. font-size: $font-size-20;
  919. }
  920. }
  921. .coupon-minMoney {
  922. width: 100%;
  923. height: 28rpx;
  924. float: left;
  925. box-sizing: border-box;
  926. padding-left: 24rpx;
  927. .txt {
  928. display: block;
  929. height: 28rpx;
  930. line-height: 28rpx;
  931. font-size: 16rpx;
  932. color: #f94b4b;
  933. text-align: center;
  934. padding: 0 5rpx;
  935. background-color: #fff1eb;
  936. border-radius: 4rpx;
  937. float: left;
  938. }
  939. }
  940. }
  941. .list-cell-ri {
  942. width: 366rpx;
  943. height: 100%;
  944. box-sizing: border-box;
  945. padding: 30rpx 20rpx;
  946. float: left;
  947. .list-cell-top {
  948. width: 100%;
  949. height: 64rpx;
  950. line-height: 64rpx;
  951. font-size: $font-size-26;
  952. color: #333333;
  953. float: left;
  954. text-overflow: ellipsis;
  955. display: -webkit-box;
  956. word-break: break-all;
  957. -webkit-box-orient: vertical;
  958. -webkit-line-clamp: 1;
  959. overflow: hidden;
  960. }
  961. .list-cell-time {
  962. width: 100%;
  963. height: 28rpx;
  964. line-height: 28rpx;
  965. text-align: left;
  966. font-size: $font-size-20;
  967. color: #999999;
  968. }
  969. }
  970. }
  971. .coupon-btn {
  972. width: 100%;
  973. height: 78rpx;
  974. background: url(https://static.caimei365.com/app/img/icon/icon-coupon-alertbtnbg@2x.png);
  975. background-size: cover;
  976. line-height: 78rpx;
  977. text-align: center;
  978. color: #ffffff;
  979. font-size: $font-size-36;
  980. }
  981. }
  982. }
  983. }
  984. </style>