orderDetail.vue 34 KB

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