create-order.vue 30 KB

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