orderDetail.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372
  1. <template>
  2. <view class="container">
  3. <view class="order-type-info">
  4. <view class="order-type-title">{{orderType.title}}</view>
  5. <view class="order-type-text">{{orderType.text}}
  6. </view>
  7. </view>
  8. <view class="address-info-box">
  9. <view class="address-icon">
  10. <text class="iconfont icondizhi"></text>
  11. </view>
  12. <view class="address-content">
  13. <text class="address-info">
  14. <text class="address-name">{{orderData.recName}}</text>
  15. <text class="address-phone">{{orderData.recMobile}}</text>
  16. </text>
  17. <view class="address-detail">{{orderData.address}}</view>
  18. </view>
  19. </view>
  20. <view class="goods-info-box">
  21. <view class="shop-info" @click.stop="gotoShop()">
  22. <text class="iconfont icondianpu"></text>
  23. <text class="shop-name">{{orderData.merchantInfoResVO.supplierName}}</text>
  24. <text class="iconfont iconfangxiang" v-if="orderData.tenantCode != 'admin'"></text>
  25. </view>
  26. <view class="goods-list">
  27. <view class="goods-row" v-for="(item, index) in orderData.merchantInfoResVO.products" :key="index">
  28. <image class="goods-img" :src="item.imgUrl" mode="aspectFill"></image>
  29. <view class="goods-info">
  30. <view class="goods-name">{{item.productName}}</view>
  31. <view class="goods-type">
  32. 类型:{{item.productType == 1 ? '普通商品' : (item.productType == 2 ? '拍卖商品' : (item.productType == 3 ? '自助采摘' : '共享种植'))}}
  33. </view>
  34. <view class="plant-area" v-if="item.productType == 4">面积:{{item.areaSize}}㎡</view>
  35. <view class="goods-price-number">
  36. <text class="goods-unit">¥</text>
  37. <text class="goods-price">{{item.bizPrice}}</text>
  38. <text class="goods-number">x{{item.buyNum}}</text>
  39. <text class="plant-text" v-if="item.productType == 4">有效期:{{item.term}}天</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="order-info">
  45. <u-cell-group :border="false">
  46. <u-cell-item title="商品金额" :value="'¥' + orderData.orderSum" :arrow="false" :border-bottom="false"></u-cell-item>
  47. <u-cell-item title="积分抵扣" :value="'-¥' + orderData.integralAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
  48. <u-cell-item title="优惠券" :value="'-¥' + orderData.couponDiscountAmount" :arrow="false" :border-bottom="false" v-if="goodType == 1 || goodType == 3"></u-cell-item>
  49. <u-cell-item title="备注" :value="orderData.notes" :arrow="false" :border-bottom="false"></u-cell-item>
  50. </u-cell-group>
  51. </view>
  52. <view class="pay-info">
  53. <text class="pay-text">实付款</text>
  54. <text class="pay-price">¥{{orderData.paySum}}</text>
  55. </view>
  56. </view>
  57. <view class="order-info-box" @click="goToMessage()">
  58. <view class="info-title-box">
  59. <view class="info-title">留言板</view>
  60. <text class="iconfont iconfangxiang"></text>
  61. </view>
  62. <view class="info-content-box">
  63. <view class="message-row" v-for="(item, index1) in orderData.leas" :key="index1">
  64. <image class="message-head" :src="item.headImg" mode="aspectFill"></image>
  65. <view class="message-info-box">
  66. <view class="message-name">{{item.name}}</view>
  67. <view class="message-date">{{item.leaMsgTime}}</view>
  68. <view class="message-text">{{item.leaMsgContent}}</view>
  69. <!-- <view class="message-img-box" v-for="(site, index2) in item.orderLeaImgResVOs" :key="index2">
  70. <image class="message-img" :src="site.imgUrl" mode="aspectFill"></image>
  71. </view> -->
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="order-info-box">
  77. <view class="info-title-box">
  78. <view class="info-title">订单信息</view>
  79. </view>
  80. <view class="info-content-box">
  81. <view class="order-info-row">订单编号:{{orderData.orderCode}}</view>
  82. <view class="order-info-row">创建时间:{{orderData.addOrderTime}}</view>
  83. <view class="order-info-row" v-if="orderData.orderStatus > 1 && orderData.orderStatus != 6">支付时间:{{orderData.payTime ? orderData.payTime : orderData.addOrderTime}}</view>
  84. <view class="order-info-row" v-if="orderData.orderStatus > 2 && orderData.orderStatus != 6 && orderData.orderStatus != 4">发货时间:{{orderData.sendTime ? orderData.sendTime : '-'}}</view>
  85. <view class="order-info-row" v-if="orderData.orderStatus > 3 && orderData.orderStatus != 6 && orderData.orderStatus != 4">收货时间:{{orderData.confirmTime ? orderData.sendTime : '-'}}</view>
  86. <view class="order-info-row" v-if="orderData.orderStatus == 6">取消时间:{{orderData.cancelTime}}</view>
  87. </view>
  88. </view>
  89. <view class="order-info-box" v-if="orderData.evaluateResVO.evaluateContent">
  90. <view class="info-title-box">
  91. <view class="info-title">评价信息</view>
  92. </view>
  93. <view class="info-content-box">
  94. <view class="assess-row">
  95. <image class="assess-head" mode="aspectFill" :src="orderData.merchantInfoResVO.headImg"></image>
  96. <view class="assess-info">
  97. <view class="assess-name">{{orderData.nickname}}</view>
  98. <view class="assess-date">{{orderData.evaluateResVO.evaluateTime ? orderData.evaluateResVO.evaluateTime : ''}}</view>
  99. <view class="assess-sore-box">
  100. <u-rate v-model="orderData.evaluateResVO.score" active-color="#FFAE21" disabled></u-rate>
  101. </view>
  102. <view class="assess-text">{{orderData.evaluateResVO.evaluateContent ? orderData.evaluateResVO.evaluateContent : '暂无评价'}}</view>
  103. <view class="assess-img-box">
  104. <image class="img-col" mode="aspectFill" :src="item.imgUrl" v-for="(item,i) in orderData.evaluateResVO.evaluateImgs"
  105. :key="i" @tap="_previewImage(item.imgUrl,i)"></image>
  106. </view>
  107. </view>
  108. <view class="shop-reply-box" v-if="orderData.evaluateResVO.replyContent">
  109. <view class="shop-head">
  110. <view class="iconfont icondianpu"></view>
  111. <view class="shop-name">店家回复</view>
  112. </view>
  113. <view class="shop-reply">{{orderData.evaluateResVO.replyContent}}</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <!-- </view> -->
  119. <uni-goods-nav :fill="true" :options="[]" @click="" @buttonClick="orderHandle" class="order-handle" :buttonGroup="buttonGroup" />
  120. <u-modal v-model="modalShow" :content="modalContent" @confirm="submitHandle" :async-close="true" :show-cancel-button="true"></u-modal>
  121. <u-top-tips ref="uTips"></u-top-tips>
  122. <view class="uni-popup-dialog" :hidden="show_qx">
  123. <view class="uni-dialog-title">
  124. <text class="uni-dialog-title-text">提示</text>
  125. </view>
  126. <view class="uni-dialog-content">
  127. <text class="uni-dialog-content-text">请在设置中开启摄像头权限和麦克风权限</text>
  128. </view>
  129. <view class="uni-dialog-button-group">
  130. <button class="uni-dialog-button uni-border-left" open-type="openSetting" @click="closeSetting">
  131. 设置权限
  132. </button>
  133. </view>
  134. </view>
  135. <view class="qx_bg" :hidden="show_qx">
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. const NET = require('@/utils/request')
  141. const API = require('@/config/api')
  142. export default {
  143. components: {},
  144. data() {
  145. return {
  146. show_qx: true,
  147. orderType: {
  148. title: '',
  149. text: '',
  150. },
  151. orderData: {
  152. orderId: '',
  153. addOrderTime: '',
  154. recName: '',
  155. recMobile: '',
  156. address: '',
  157. merchantInfoResVO: {
  158. supplierName: '',
  159. products: [],
  160. },
  161. evaluateResVO: {},
  162. orderSum: 0,
  163. integralAmount: 0,
  164. couponDiscountAmount: 0,
  165. notes: 'xxxxx',
  166. paySum: 0,
  167. leas: [],
  168. orderCode: '',
  169. payTime: '',
  170. sendTime: '',
  171. confirmTime: '',
  172. cancelTime: '',
  173. tenantCode: '',
  174. evaluateReplyStatus: 1,
  175. },
  176. goodType: 1, // 1是普通商品类型;3是包含自助采摘+普通商品的类型;2是拍卖、共享种植
  177. buttonGroup: [],
  178. modalShow: false,
  179. handleType: '',
  180. modalContent: '',
  181. }
  182. },
  183. onLoad(options) {
  184. this.userData = uni.getStorageSync("userData")
  185. NET.request(API.getOrderDetail, {
  186. flag: 1,
  187. orderId: options.orderId,
  188. orderStatus: options.orderStatus,
  189. }, 'GET').then(res => {
  190. this.orderData = res.data
  191. if (this.orderData.addOrderTime) {
  192. let tempTime = new Date(this.orderData.addOrderTime.replace(/\-/g, '/')).getTime()
  193. let addTempTime = new Date(tempTime + 1000 * 60 * 60 * 24)
  194. let addYear = addTempTime.getFullYear()
  195. let addMonth = addTempTime.getMonth() + 1
  196. let addDay = addTempTime.getDate()
  197. let addHours = addTempTime.getHours()
  198. let addMin = addTempTime.getMinutes()
  199. let addSeconds = addTempTime.getSeconds()
  200. this.orderData.overTime = addYear + '年' + addMonth + '月' + addDay + '日' + addHours + ':' + addMin + ':' +
  201. addSeconds
  202. // this.orderData.tempTimeArr = this.orderData.addOrderTime.split(' ')
  203. // let tempDate = new Date(this.orderData.tempTimeArr[0].replace(/-/g, "/"))
  204. // this.orderData.overTime = new Date(tempDate.setDate(tempDate.getDate() + 1))
  205. }
  206. // 1是普通商品类型;3是包含自助采摘+普通商品的类型;2是拍卖、共享种植
  207. if (this.orderData.merchantInfoResVO.products.length) {
  208. if (this.orderData.merchantInfoResVO.products.every(v => {
  209. return (v.productType == 1)
  210. })) {
  211. this.goodType = 1
  212. } else if (this.orderData.merchantInfoResVO.products.some(v => {
  213. return (v.productType == 3)
  214. })) {
  215. this.goodType = 3
  216. } else if (this.orderData.merchantInfoResVO.products[0].productType == 2 || this.orderData.merchantInfoResVO.products[
  217. 0].productType == 4) {
  218. this.goodType = 2
  219. }
  220. }
  221. // if (this.orderData.merchantInfoResVO.products.length && this.orderData.merchantInfoResVO.products[0].productType !=
  222. // 2 && this.orderData.merchantInfoResVO.products[0].productType != 4) {
  223. // debugger
  224. // if (this.orderData.merchantInfoResVO.products.some(v=>{v.productType == 3})) {
  225. // this.goodType = 3
  226. // } else {
  227. // this.goodType = 1
  228. // }
  229. // } else {
  230. // this.goodType = 2
  231. // }
  232. switch (JSON.stringify(this.orderData.orderStatus)) {
  233. case '1':
  234. if (this.goodType == 3) {
  235. this.buttonGroup = [{
  236. text: '取消订单',
  237. backgroundColor: '#75BD60',
  238. color: '#fff'
  239. }, {
  240. text: '立即支付',
  241. backgroundColor: '#52A63A',
  242. color: '#fff'
  243. }, {
  244. text: '自助采摘',
  245. backgroundColor: '#75BD60',
  246. color: '#fff'
  247. }]
  248. } else {
  249. this.buttonGroup = [{
  250. text: '取消订单',
  251. backgroundColor: '#75BD60',
  252. color: '#fff'
  253. }, {
  254. text: '立即支付',
  255. backgroundColor: '#52A63A',
  256. color: '#fff'
  257. }]
  258. }
  259. break;
  260. case '2':
  261. var someVaule = this.orderData.merchantInfoResVO.products.some(v => {
  262. Number(v.productType)
  263. return v.productType == 1
  264. })
  265. if (!someVaule) {
  266. if (this.orderData.merchantInfoResVO.products.every(v => {
  267. Number(v.productType)
  268. return v.productType == 3
  269. })) {
  270. this.buttonGroup = [{
  271. text: '申请售后',
  272. backgroundColor: '#75BD60',
  273. color: '#fff'
  274. }, {
  275. text: '自助采摘',
  276. backgroundColor: '#52A63A',
  277. color: '#fff'
  278. }]
  279. } else {
  280. this.buttonGroup = [{
  281. text: '申请售后',
  282. backgroundColor: '#75BD60',
  283. color: '#fff'
  284. }]
  285. }
  286. } else {
  287. this.buttonGroup = [{
  288. text: '申请售后',
  289. backgroundColor: '#75BD60',
  290. color: '#fff'
  291. }]
  292. }
  293. break;
  294. case '3':
  295. this.buttonGroup = [{
  296. text: '申请售后',
  297. backgroundColor: '#52A63A',
  298. color: '#fff'
  299. }, {
  300. text: '确认收货',
  301. backgroundColor: '#52A63A',
  302. color: '#fff'
  303. }, {
  304. text: '追踪物流',
  305. backgroundColor: '#52A63A',
  306. color: '#fff'
  307. }]
  308. break;
  309. case '4':
  310. if (this.orderData.merchantInfoResVO.products.every(v => {
  311. Number(v.productType)
  312. return v.productType == 4
  313. })) {
  314. this.buttonGroup = [{
  315. text: '申请售后',
  316. backgroundColor: '#75BD60',
  317. color: '#fff'
  318. }, {
  319. text: '我的种植',
  320. backgroundColor: '#52A63A',
  321. color: '#fff'
  322. }]
  323. } else {
  324. this.buttonGroup = [{
  325. text: '申请售后',
  326. backgroundColor: '#75BD60',
  327. color: '#fff'
  328. }]
  329. }
  330. break;
  331. default:
  332. this.buttonGroup = [{
  333. text: '申请售后',
  334. backgroundColor: '#52A63A',
  335. color: '#fff'
  336. }]
  337. }
  338. if (this.orderData.orderStatus == 4 && this.orderData.evaluateReplyStatus == 1) {
  339. if (this.orderData.orderType != 3 && this.orderData.orderType != 4)
  340. this.buttonGroup.push({
  341. text: '评价',
  342. backgroundColor: '#52A63A',
  343. color: '#fff'
  344. })
  345. }
  346. this.getOrderType()
  347. }).catch(error => {
  348. this.$refs.uTips.show({
  349. title: error.data.msg,
  350. type: 'warning',
  351. })
  352. })
  353. // this.getOrderType()
  354. },
  355. onShow() {},
  356. methods: {
  357. closeSetting: function() {
  358. this.show_qx = true;
  359. },
  360. // 获取订单类型
  361. getOrderType() {
  362. if (!this.orderData.auctionStatus) {
  363. switch (this.orderData.orderStatus) {
  364. case 1:
  365. this.orderType = {
  366. title: '等待买家付款',
  367. text: '订单将于' + this.orderData.overTime + '关闭',
  368. date: this.orderData.overTime
  369. }
  370. break;
  371. case 2:
  372. this.orderType = {
  373. title: '等待卖家发货',
  374. text: '您的商品正在打包等待发货',
  375. }
  376. break;
  377. case 3:
  378. this.orderType = {
  379. title: '等待商品送达',
  380. text: '您的商品已发出正在路上,请耐心等待',
  381. }
  382. break;
  383. case 4:
  384. this.orderType = {
  385. title: '商品已送达',
  386. text: '',
  387. }
  388. break;
  389. case 5:
  390. this.orderType = {
  391. title: '交易已完成',
  392. text: '',
  393. }
  394. break;
  395. default:
  396. this.orderType = {
  397. title: '交易已取消',
  398. text: '',
  399. }
  400. }
  401. } else {
  402. switch (this.orderData.auctionStatus) {
  403. case 1:
  404. this.orderType = {
  405. title: '竞拍中',
  406. text: '',
  407. }
  408. break;
  409. case 2:
  410. switch (this.orderData.orderStatus) {
  411. case 2:
  412. this.orderType = {
  413. title: '竞拍成功-等待卖家发货',
  414. text: '您的商品正在打包等待发货',
  415. }
  416. break;
  417. case 3:
  418. this.orderType = {
  419. title: '竞拍成功-等待商品送达',
  420. text: '您的商品已发出正在路上,请耐心等待',
  421. }
  422. break;
  423. case 4:
  424. this.orderType = {
  425. title: '竞拍成功-商品已送达',
  426. text: '',
  427. }
  428. break;
  429. case 5:
  430. this.orderType = {
  431. title: '竞拍成功-交易已完成',
  432. text: '',
  433. }
  434. break;
  435. }
  436. break;
  437. case 3:
  438. this.orderType = {
  439. title: '竞拍失败',
  440. text: '',
  441. }
  442. break;
  443. }
  444. }
  445. },
  446. // 操作
  447. orderHandle(e) {
  448. if (this.orderData.orderStatus == 1) {
  449. if (e.index == 0) {
  450. // 取消订单
  451. this.modalContent = '请确定是否取消订单'
  452. this.handleType = 1
  453. this.modalShow = true
  454. } else if (e.index == 1) {
  455. // 立即支付
  456. this.modalContent = '请确定是否立即支付'
  457. this.handleType = 2
  458. this.modalShow = true
  459. } else if (e.index == 2) {
  460. // 跳转自助采摘
  461. this.goPickVideo()
  462. }
  463. } else {
  464. if (e.index == 0) {
  465. // 申请售后
  466. NET.request(API.applyService, {
  467. tenantCode: this.orderData.tenantCode
  468. }, 'GET').then(res => {
  469. uni.makePhoneCall({
  470. phoneNumber: res.data.contactTel
  471. });
  472. }).catch(error => {
  473. this.$refs.uTips.show({
  474. title: error.data.msg,
  475. type: 'warning',
  476. })
  477. })
  478. } else {
  479. if (this.orderData.orderStatus == 2) {
  480. // 自助采摘
  481. this.goPickVideo()
  482. } else if (this.orderData.orderStatus == 3) {
  483. if (e.index == 1) {
  484. // 确认收货
  485. this.modalContent = '请确定是否确认收货'
  486. this.handleType = 3
  487. this.modalShow = true
  488. } else {
  489. // 追踪物流
  490. uni.navigateTo({
  491. url: '/pagesMain/logisticsDeatil?logisticCode=' + this.orderData.logisticsNum
  492. });
  493. }
  494. } else if (this.orderData.orderStatus == 4) {
  495. if (e.index == 1 && this.goodType == 2) {
  496. // 去我的种植
  497. uni.navigateTo({
  498. url: '/pagesGood/goodDetails?minePlant=true&goodId=' + this.orderData.merchantInfoResVO.products[0].productId +
  499. '&orderId=' + this.orderData.orderId
  500. });
  501. } else {
  502. // 评价
  503. uni.navigateTo({
  504. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode +
  505. '&productIds=' + this.orderData.merchantInfoResVO.products.map(site => {
  506. return site.productId
  507. }).join(',')
  508. });
  509. }
  510. } else {
  511. // 评价
  512. uni.navigateTo({
  513. url: '/pagesMain/evaluateForm?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode +
  514. '&productIds=' + this.orderData.merchantInfoResVO.products.map(site => {
  515. return site.productId
  516. }).join(',')
  517. });
  518. }
  519. }
  520. }
  521. },
  522. // 状态流转
  523. submitHandle() {
  524. if (this.handleType == 1) {
  525. // 取消订单
  526. NET.request(API.cancelOrder, {
  527. orderId: this.orderData.orderId
  528. }, 'GET').then(res => {
  529. this.modalShow = false
  530. this.$refs.uTips.show({
  531. title: '取消订单成功',
  532. type: 'success',
  533. })
  534. setTimeout(() => {
  535. uni.reLaunch({
  536. url: '/pagesMain/orderList?type=' + 1
  537. });
  538. }, 1000)
  539. }).catch(error => {
  540. this.modalShow = false
  541. this.$refs.uTips.show({
  542. title: error.data.msg,
  543. type: 'warning',
  544. })
  545. })
  546. } else if (this.handleType == 2) {
  547. // 立即支付
  548. NET.request(API.payOrder, {
  549. mid: uni.getStorageSync("userData").userId,
  550. orderCode: this.orderData.orderCode,
  551. orderId: this.orderData.orderId,
  552. // #ifdef APP-PLUS
  553. channel: 2
  554. //#endif
  555. }, 'POST').then(res => {
  556. this.modalShow = false
  557. // #ifdef MP-WEIXIN
  558. uni.requestPayment({
  559. provider: 'wxpay',
  560. timeStamp: res.data.timeStamp,
  561. nonceStr: res.data.nonceStr,
  562. package: res.data.packageValue,
  563. signType: res.data.signType,
  564. paySign: res.data.paySign,
  565. success: (payRes) => {
  566. console.log('success:' + JSON.stringify(payRes));
  567. // if (this.goodType == 3) {
  568. // uni.navigateTo({
  569. // url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId + '&goodType=' + this.goodType + '&tenantCode=' + this.orderData.tenantCode
  570. // });
  571. // } else {
  572. uni.navigateTo({
  573. url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
  574. });
  575. // }
  576. },
  577. fail: (error) => {
  578. console.log('fail:' + JSON.stringify(error));
  579. this.$refs.uTips.show({
  580. title: '支付失败',
  581. type: 'warning',
  582. })
  583. }
  584. })
  585. //#endif
  586. // #ifdef APP-PLUS
  587. uni.requestPayment({
  588. provider: 'wxpay',
  589. orderInfo: {
  590. "package": res.data.packageValue,
  591. "appid": res.data.appId,
  592. "sign": res.data.paySign,
  593. "partnerid": res.data.partnerId,
  594. "prepayid": res.data.prepayId,
  595. "noncestr": res.data.nonceStr,
  596. "timestamp": res.data.timeStamp,
  597. },
  598. success: (payRes) => {
  599. console.log('success:' + JSON.stringify(payRes));
  600. uni.navigateTo({
  601. url: '/pagesMain/paySuccess?orderId=' + this.orderData.orderId
  602. });
  603. },
  604. fail: (error) => {
  605. console.log('fail:' + JSON.stringify(error));
  606. this.$refs.uTips.show({
  607. title: '支付失败',
  608. type: 'warning',
  609. })
  610. }
  611. })
  612. // #endif
  613. }).catch(error => {
  614. this.modalShow = false
  615. this.$refs.uTips.show({
  616. title: error.data.msg,
  617. type: 'warning',
  618. })
  619. })
  620. // setTimeout(() => {
  621. // uni.reLaunch({
  622. // url: '/pagesMain/orderList?type=' + 3
  623. // });
  624. // }, 1000)
  625. } else if (this.handleType == 3) {
  626. // 确认收货
  627. NET.request(API.confirmOrder, {
  628. orderId: this.orderData.orderId
  629. }, 'GET').then(res => {
  630. this.modalShow = false
  631. this.$refs.uTips.show({
  632. title: '确认收货成功',
  633. type: 'success',
  634. })
  635. setTimeout(() => {
  636. uni.reLaunch({
  637. url: '/pagesMain/orderList?type=' + 5
  638. });
  639. }, 1000)
  640. }).catch(error => {
  641. this.modalShow = false
  642. this.$refs.uTips.show({
  643. title: error.data.msg,
  644. type: 'warning',
  645. })
  646. })
  647. }
  648. },
  649. // 跳转自助采摘直播
  650. goPickVideo() {
  651. var that = this;
  652. if (uni.getStorageSync("firstTimeLiveUser") == "") {
  653. uni.setStorage({
  654. key: 'firstTimeLiveUser',
  655. data: 1
  656. })
  657. uni.navigateTo({
  658. url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
  659. });
  660. } else {
  661. wx.getSetting({
  662. success(res) {
  663. /*if (!res.authSetting['scope.camera']){
  664. that.show_qx=false;
  665. }else*/
  666. if (!res.authSetting['scope.record']) {
  667. that.show_qx = false;
  668. } else {
  669. uni.navigateTo({
  670. url: '/pagesGood/pickVideo?orderId=' + that.orderData.orderId + '&tenantCode=' + that.orderData.tenantCode
  671. });
  672. }
  673. }
  674. })
  675. }
  676. },
  677. // 跳转留言列表
  678. goToMessage() {
  679. uni.navigateTo({
  680. url: '/pagesMain/messageList?orderId=' + this.orderData.orderId + '&tenantCode=' + this.orderData.tenantCode
  681. });
  682. },
  683. // 跳转商铺
  684. gotoShop() {
  685. if (this.orderData.tenantCode != 'admin') {
  686. if (this.orderData.merchantInfoResVO.products.length) {
  687. uni.navigateTo({
  688. url: '/pagesGood/shopDetails?goodId=' + this.orderData.merchantInfoResVO.products[0].productId
  689. });
  690. }
  691. }
  692. },
  693. // 图片预览
  694. _previewImage(image, index) {
  695. var imgArr = [];
  696. imgArr.push(image);
  697. //预览图片
  698. uni.previewImage({
  699. urls: imgArr,
  700. current: imgArr[index]
  701. });
  702. }
  703. }
  704. }
  705. </script>
  706. <style>
  707. page {
  708. background-color: #f7f7f7;
  709. }
  710. </style>
  711. <style lang="less" scoped>
  712. page {
  713. width: 100%;
  714. height: 100%;
  715. }
  716. .container {
  717. width: 100%;
  718. height: 100%;
  719. float: left;
  720. background-color: #f7f7f7;
  721. // box-sizing: border-box;
  722. padding-bottom: 50px;
  723. overflow-y: auto;
  724. .order-type-info {
  725. width: 100%;
  726. height: 115px;
  727. float: left;
  728. box-sizing: border-box;
  729. padding: 22px 100px 0 15px;
  730. background: #52A63A;
  731. border-radius: 0px 0px 20px 20px;
  732. background-size: 62px;
  733. background-position: calc(100% - 48px) 12px;
  734. background-repeat: no-repeat;
  735. background-image: url(@/static/images/orderDetail.png);
  736. .order-type-title {
  737. width: 100%;
  738. float: left;
  739. height: 20px;
  740. line-height: 20px;
  741. font-size: 15px;
  742. font-family: PingFang SC;
  743. color: #FFFFFF;
  744. margin-bottom: 4px;
  745. }
  746. .order-type-text {
  747. width: 100%;
  748. float: left;
  749. height: 20px;
  750. line-height: 20px;
  751. font-size: 12px;
  752. font-family: PingFang SC;
  753. color: #FFFFFF;
  754. }
  755. }
  756. .address-info-box {
  757. width: calc(100% - 30px);
  758. float: left;
  759. box-sizing: border-box;
  760. padding: 16px 18px 16px 16px;
  761. margin: -34px 15px 10px 15px;
  762. background: #FFFFFF;
  763. border-radius: 10px;
  764. .address-icon {
  765. width: 36px;
  766. height: 40px;
  767. float: left;
  768. align-items: center;
  769. display: flex;
  770. .iconfont {
  771. color: #52A63A;
  772. font-size: 36px;
  773. }
  774. }
  775. .address-content {
  776. width: calc(100% - 56px);
  777. height: 40px;
  778. float: left;
  779. margin: 0 8px 0 12px;
  780. .address-info {
  781. height: 20px;
  782. font-family: PingFang SC;
  783. line-height: 20px;
  784. overflow: hidden;
  785. text-overflow: ellipsis;
  786. white-space: nowrap;
  787. .address-name {
  788. font-size: 16px;
  789. color: #333333;
  790. margin-right: 14px;
  791. }
  792. .address-phone {
  793. font-size: 12px;
  794. color: #666666;
  795. }
  796. }
  797. .address-detail {
  798. height: 20px;
  799. font-size: 16px;
  800. font-family: PingFang SC;
  801. color: #333333;
  802. line-height: 20px;
  803. overflow: hidden;
  804. text-overflow: ellipsis;
  805. white-space: nowrap;
  806. }
  807. }
  808. }
  809. .goods-info-box {
  810. width: calc(100% - 30px);
  811. float: left;
  812. margin: 0 15px 10px 15px;
  813. background: #FFFFFF;
  814. border-radius: 10px;
  815. .shop-info {
  816. width: 100%;
  817. height: 48px;
  818. float: left;
  819. box-sizing: border-box;
  820. padding: 13px 15px 12px 15px;
  821. border-bottom: 1px solid #EEEEEE;
  822. line-height: 22px;
  823. .icondianpu {
  824. font-size: 22px;
  825. color: #333333;
  826. }
  827. .shop-name {
  828. font-size: 15px;
  829. font-family: PingFang SC;
  830. color: #333333;
  831. margin: 0 8px 0 10px;
  832. }
  833. .iconshangjia {
  834. font-size: 12px;
  835. color: #999999;
  836. }
  837. }
  838. .goods-list {
  839. width: 100%;
  840. float: left;
  841. box-sizing: border-box;
  842. padding: 10px 15px 0 15px;
  843. .goods-row {
  844. width: 100%;
  845. height: 90px;
  846. float: left;
  847. display: flex;
  848. margin-bottom: 10px;
  849. .goods-img {
  850. width: 90px;
  851. height: 90px;
  852. border-radius: 5px;
  853. object-fit: cover;
  854. }
  855. .goods-info {
  856. width: calc(100% - 106px);
  857. height: 90px;
  858. margin-left: 16px;
  859. .goods-name {
  860. width: 100%;
  861. height: 36px;
  862. float: left;
  863. font-size: 14px;
  864. font-family: PingFang SC;
  865. color: #333333;
  866. line-height: 18px;
  867. overflow: hidden;
  868. text-overflow: ellipsis;
  869. display: -webkit-box;
  870. -webkit-line-clamp: 2;
  871. -webkit-box-orient: vertical;
  872. word-wrap: break-word;
  873. }
  874. .goods-type {
  875. height: 20px;
  876. float: left;
  877. background: #F0F0F0;
  878. border-radius: 4px;
  879. padding: 0 8px;
  880. margin: 6px 0;
  881. font-size: 10px;
  882. font-family: PingFang SC;
  883. color: #666666;
  884. line-height: 20px;
  885. }
  886. .plant-area {
  887. height: 20px;
  888. float: right;
  889. margin: 6px 0;
  890. font-size: 12px;
  891. font-family: PingFang SC;
  892. color: #333333;
  893. }
  894. .goods-price-number {
  895. width: 100%;
  896. height: 20px;
  897. float: left;
  898. line-height: 20px;
  899. font-family: PingFang SC;
  900. color: #333333;
  901. .goods-unit {
  902. font-size: 12px;
  903. }
  904. .goods-price {
  905. font-size: 15px;
  906. margin-right: 6px;
  907. }
  908. .goods-number {
  909. font-size: 12px;
  910. }
  911. }
  912. .plant-text {
  913. float: right;
  914. font-size: 12px;
  915. font-family: PingFang SC;
  916. color: #333333;
  917. }
  918. }
  919. }
  920. }
  921. .order-info {
  922. width: 100%;
  923. float: left;
  924. /deep/.u-cell {
  925. padding: 6px 16px;
  926. }
  927. }
  928. .pay-info {
  929. width: 100%;
  930. height: 46px;
  931. float: left;
  932. box-sizing: border-box;
  933. border-top: 1px solid #EEEEEE;
  934. padding-right: 15px;
  935. line-height: 44px;
  936. font-family: PingFang SC;
  937. font-size: 14px;
  938. text-align: right;
  939. white-space: nowrap;
  940. .pay-text {
  941. float: left;
  942. color: #333333;
  943. margin-left: 15px;
  944. }
  945. .pay-price {
  946. color: #52A63A;
  947. }
  948. }
  949. }
  950. .order-info-box {
  951. width: calc(100% - 30px);
  952. float: left;
  953. margin: 0 15px 10px 15px;
  954. background: #FFFFFF;
  955. border-radius: 10px;
  956. .info-title-box {
  957. width: 100%;
  958. height: 48px;
  959. float: left;
  960. box-sizing: border-box;
  961. padding: 15px 15px 14px 15px;
  962. border-bottom: 1px solid #EEEEEE;
  963. line-height: 18px;
  964. white-space: nowrap;
  965. .info-title {
  966. height: 18px;
  967. float: left;
  968. font-size: 15px;
  969. font-family: PingFang SC;
  970. color: #333333;
  971. margin-right: 8px;
  972. padding-left: 10px;
  973. border-left: 2px solid #74BD60;
  974. }
  975. .iconfangxiang {
  976. float: right;
  977. font-size: 12px;
  978. color: #999999;
  979. }
  980. }
  981. .info-content-box {
  982. width: 100%;
  983. float: left;
  984. padding: 15px 0;
  985. .message-row {
  986. width: 100%;
  987. float: left;
  988. box-sizing: border-box;
  989. padding: 0 15px;
  990. margin-bottom: 15px;
  991. .message-head {
  992. width: 50px;
  993. height: 50px;
  994. object-fit: cover;
  995. float: left;
  996. border-radius: 50%;
  997. overflow: hidden;
  998. }
  999. .message-info-box {
  1000. width: calc(100% - 75px);
  1001. float: right;
  1002. .message-name {
  1003. width: 50%;
  1004. height: 30px;
  1005. float: left;
  1006. font-size: 15px;
  1007. font-family: PingFang SC;
  1008. color: #333333;
  1009. line-height: 30px;
  1010. overflow: hidden;
  1011. text-overflow: ellipsis;
  1012. white-space: nowrap;
  1013. }
  1014. .message-date {
  1015. width: 50%;
  1016. height: 30px;
  1017. float: left;
  1018. font-size: 12px;
  1019. font-family: PingFang SC;
  1020. color: #666666;
  1021. text-align: right;
  1022. line-height: 30px;
  1023. overflow: hidden;
  1024. text-overflow: ellipsis;
  1025. white-space: nowrap;
  1026. }
  1027. .message-text {
  1028. width: 100%;
  1029. height: 20px;
  1030. float: left;
  1031. font-size: 12px;
  1032. font-family: PingFang SC;
  1033. color: #666666;
  1034. line-height: 20px;
  1035. overflow: hidden;
  1036. text-overflow: ellipsis;
  1037. white-space: nowrap;
  1038. }
  1039. .message-img-box {
  1040. width: 100%;
  1041. float: left;
  1042. .message-img {
  1043. width: 76px;
  1044. height: 76px;
  1045. object-fit: cover;
  1046. float: left;
  1047. margin: 0 10px 10px 0;
  1048. }
  1049. }
  1050. }
  1051. }
  1052. .message-row:last-child {
  1053. margin-bottom: 0;
  1054. }
  1055. .order-info-row {
  1056. width: 100%;
  1057. float: left;
  1058. box-sizing: border-box;
  1059. padding: 0 15px;
  1060. font-size: 12px;
  1061. font-family: PingFang SC;
  1062. color: #333333;
  1063. line-height: 26px;
  1064. word-break: break-all;
  1065. }
  1066. }
  1067. .assess-row {
  1068. width: calc(100% - 30px);
  1069. margin: 0 15px;
  1070. float: left;
  1071. // border-top: 1px solid #F6F6F6;
  1072. padding: 12px 0;
  1073. .assess-head {
  1074. width: 50px;
  1075. height: 50px;
  1076. float: left;
  1077. object-fit: cover;
  1078. border-radius: 50%;
  1079. }
  1080. .assess-info {
  1081. width: calc(100% - 62px);
  1082. margin-left: 12px;
  1083. float: left;
  1084. .assess-name {
  1085. height: 18px;
  1086. float: left;
  1087. line-height: 18px;
  1088. font-size: 15px;
  1089. font-family: PingFang SC;
  1090. font-weight: bold;
  1091. color: #343434;
  1092. }
  1093. .assess-date {
  1094. height: 18px;
  1095. float: right;
  1096. line-height: 18px;
  1097. font-size: 12px;
  1098. font-family: PingFang SC;
  1099. font-weight: bold;
  1100. color: #666666;
  1101. }
  1102. .assess-sore-box {
  1103. width: 100%;
  1104. height: 16px;
  1105. float: left;
  1106. margin: 6px 0;
  1107. }
  1108. .assess-text {
  1109. width: 100%;
  1110. float: left;
  1111. font-size: 12px;
  1112. font-family: PingFang SC;
  1113. font-weight: bold;
  1114. color: #666666;
  1115. line-height: 16px;
  1116. margin: 8px 0 10px 0;
  1117. overflow: hidden;
  1118. text-overflow: ellipsis;
  1119. display: -webkit-box;
  1120. -webkit-line-clamp: 2;
  1121. -webkit-box-orient: vertical;
  1122. word-wrap: break-word;
  1123. }
  1124. .assess-img-box {
  1125. width: 100%;
  1126. float: left;
  1127. display: flex;
  1128. .img-col {
  1129. height: 60px;
  1130. width: 60px;
  1131. object-fit: cover;
  1132. margin: 0 10px 10px 0;
  1133. }
  1134. }
  1135. }
  1136. .shop-reply-box {
  1137. width: 100%;
  1138. float: left;
  1139. background: #F5F5F5;
  1140. border-radius: 5px;
  1141. margin-top: 10px;
  1142. .shop-head {
  1143. width: 100%;
  1144. height: 36px;
  1145. float: left;
  1146. box-sizing: border-box;
  1147. padding: 10px 12px;
  1148. .icondianpu {
  1149. width: 16px;
  1150. height: 16px;
  1151. float: left;
  1152. color: #52A63A;
  1153. font-size: 20px;
  1154. margin-right: 8px;
  1155. }
  1156. .shop-name {
  1157. height: 16px;
  1158. float: left;
  1159. font-size: 15px;
  1160. font-family: PingFang SC;
  1161. color: #52A63A;
  1162. line-height: 16px;
  1163. }
  1164. }
  1165. .shop-reply {
  1166. width: 100%;
  1167. float: left;
  1168. box-sizing: border-box;
  1169. padding: 0 12px 12px 12px;
  1170. font-size: 12px;
  1171. font-family: PingFang SC;
  1172. color: #666666;
  1173. line-height: 16px;
  1174. }
  1175. }
  1176. }
  1177. }
  1178. .order-handle {
  1179. width: 100%;
  1180. height: 50px;
  1181. float: left;
  1182. border-top: 1px solid #cccccc;
  1183. position: fixed;
  1184. bottom: 0;
  1185. left: 0;
  1186. }
  1187. }
  1188. .uni-popup-dialog {
  1189. width: 80vw;
  1190. border-radius: 15px;
  1191. background-color: #fff;
  1192. position: fixed;
  1193. margin-left: 10vw;
  1194. top: 34vh;
  1195. z-index: 1001;
  1196. }
  1197. .uni-dialog-title {
  1198. /* #ifndef APP-NVUE */
  1199. display: flex;
  1200. /* #endif */
  1201. flex-direction: row;
  1202. justify-content: center;
  1203. padding-top: 15px;
  1204. padding-bottom: 5px;
  1205. }
  1206. .uni-dialog-title-text {
  1207. font-size: 16px;
  1208. font-weight: 500;
  1209. }
  1210. .uni-dialog-content {
  1211. /* #ifndef APP-NVUE */
  1212. display: flex;
  1213. /* #endif */
  1214. flex-direction: row;
  1215. justify-content: center;
  1216. align-items: center;
  1217. padding: 5px 15px 15px 15px;
  1218. text-align: center;
  1219. }
  1220. .uni-dialog-content-text {
  1221. font-size: 14px;
  1222. color: #6e6e6e;
  1223. }
  1224. .uni-dialog-button-group {
  1225. /* #ifndef APP-NVUE */
  1226. display: flex;
  1227. /* #endif */
  1228. flex-direction: row;
  1229. border-top-color: #f5f5f5;
  1230. border-top-style: solid;
  1231. border-top-width: 1px;
  1232. }
  1233. .uni-dialog-button {
  1234. /* #ifndef APP-NVUE */
  1235. display: flex;
  1236. /* #endif */
  1237. background: rgba(0, 0, 0, 0);
  1238. border: none;
  1239. flex: 1;
  1240. flex-direction: row;
  1241. justify-content: center;
  1242. align-items: center;
  1243. height: 45px;
  1244. }
  1245. .uni-border-left {
  1246. border-left-color: #f0f0f0;
  1247. border-left-style: solid;
  1248. border-left-width: 0px;
  1249. }
  1250. .uni-dialog-button-text {
  1251. font-size: 14px;
  1252. }
  1253. .uni-button-color {
  1254. color: #007aff;
  1255. }
  1256. .uni-dialog-input {
  1257. flex: 1;
  1258. font-size: 14px;
  1259. }
  1260. .uni-popup__success {
  1261. color: #4cd964;
  1262. }
  1263. .uni-popup__warn {
  1264. color: #f0ad4e;
  1265. }
  1266. .uni-popup__error {
  1267. color: #dd524d;
  1268. }
  1269. .uni-popup__info {
  1270. color: #909399;
  1271. }
  1272. .qx_bg {
  1273. width: 100vw;
  1274. height: 100vh;
  1275. background: rgba(0, 0, 0, 0.25);
  1276. position: fixed;
  1277. top: 0px;
  1278. left: 0px;
  1279. z-index: 1000;
  1280. }
  1281. /deep/.uni-tab__cart-button-right {
  1282. border-right: 1px solid #ffffff;
  1283. }
  1284. /deep/.uni-tab__cart-button-right:last-child {
  1285. border-right: none;
  1286. }
  1287. </style>