create-order.vue 28 KB

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