create-order.vue 28 KB

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