orderItemC.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <template>
  2. <view style="background-color: whitesmoke;">
  3. <view class="itemV content" v-for="(item,indexo) in orderList">
  4. <view class="contentInRowS">
  5. <text class="timeText">{{item.ddId}}</text>
  6. <text v-if="item.collectPayment==1" class="jiedanBtdf" style="font-size: 24rpx;">{{$t('index.huodaofukan')}}</text>
  7. </view>
  8. <view class="contentColumn">
  9. <view class="contentInRowL">
  10. <text class="titleText" style="margin-left:20rpx;">{{$t('order.peisongfei')}}: {{$formPr(item.freight)}}{{$t('api.huobidanwei')}}</text>
  11. </view>
  12. <view class="contentInRowR">
  13. <text class="priceText" >{{$t('order.dingdanjin')}}: {{$formPr(item.amount)}}{{$t('api.huobidanwei')}}</text>
  14. </view>
  15. </view>
  16. <view v-if="youyouhui(item)" class="contentInRowL" style="margin-left:20rpx;">
  17. <text class="titleText">{{$t('order.youhuijine')}}:</text>
  18. <text class="titleText" style="padding-left: 20rpx;">{{getyhjr(item)}}</text>
  19. </view>
  20. <view style="width: 100%;margin-top: 20rpx;margin-left: 20rpx;" class="contentInRowL">
  21. <view v-if="item.store" class="contentColumn">
  22. <view>
  23. <text class="quhuodian">{{$t('order.quhuodian')}}</text>
  24. </view>
  25. <view style="margin-top: 20rpx;margin-left: 10rpx;width: 94%;">
  26. <text class="titleText">{{item.store.posName}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. <view style="margin-left: 20rpx;margin-top: 20rpx;" class="contentInRowL">
  31. <view style="width: 100rpx" class="contentColumn">
  32. <text class="shouhuodian">{{$t('order.shouhuodian')}}</text>
  33. </view>
  34. <view style="margin-left: 20rpx;width: 80%;" class="contentColumn">
  35. <view v-if="item.shaddress!=null" @click="openBimg(item.shaddress.annexes)">
  36. <view class="contentInRowL">
  37. <text class="titleText">{{item.shaddress.name}}</text>
  38. <text class="distenText">({{$t('order.juli')}}{{item.jvli}}Km)</text>
  39. </view>
  40. <text class="addrText">{{item.shaddress.address}}</text>
  41. <text v-if="item.remarks!=''" class="noteText">{{item.remarks}}</text>
  42. </view>
  43. <view v-for="(itemf,index) in item.food">
  44. <view class="contentInRowL" style="margin-top: 12rpx;">
  45. <myImage class="spIcon" :mysrc="itemf.image" mymode="scaleToFill" ></myImage>
  46. <view class="contentColumn" style="margin-left: 10rpx;width: 78%;">
  47. <text class="addrText">{{itemf.name}}</text>
  48. <view class="contentInRowS">
  49. <view class="contentInRowL ">
  50. <text class="kouweisku" v-for="sku in itemf.ask">{{sku}}</text>
  51. </view>
  52. <text class="addrText">{{itemf.number}}(份)</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view v-if="youyouhui(item)" class="contentColumnC psfnote">
  60. <text class="addrText" style="color:white;padding: 6rpx;">{{$t('order.qishouyhts')}}</text>
  61. </view>
  62. <view class="contentInRowS" style="width: 90%;margin-top: 20rpx;margin-left: 5%;">
  63. <text class="addrText">{{$t('zhanghu.zhuangtai')}}:{{getStateStr(item)}}</text>
  64. </view>
  65. <view class="contentInRowS" style="width: 90%;margin-top: 20rpx;margin-left: 5%;">
  66. <view class="wanchengT" style="background-color: crimson;" @click="chakantp(item)">{{$t('order.chakantp')}}</view>
  67. <view class="wanchengT" style="background-color:#006AFF;" @click="gotoMsgList(item)">{{$t('order.lianxikef')}}</view>
  68. </view>
  69. <view v-if="item.shaddress!=null" class="contentInRowS" style="align-items: flex-start;">
  70. <view class="contentColumnC" style="margin:20rpx;padding-left: 10rpx;" @click="callPhone(item.shaddress.phone,item.user)">
  71. <uni-icons custom-prefix="custom-icon" color="#006AFF" type="phone-filled" size="28"></uni-icons>
  72. <label class="jiedanText">{{$t('order.lianxi')}}</label>
  73. </view>
  74. <view class="contentColumnC" style="margin:20rpx;padding-right: 10rpx;" @click="gotoNav(item.shaddress)">
  75. <uni-icons custom-prefix="custom-icon" color="#006AFF" type="navigate-filled" size="28"></uni-icons>
  76. <label class="jiedanText">Navigation</label>
  77. </view>
  78. <view v-if="canopenBimg(item.shaddress.annexes)" class="contentColumnC" style="margin:20rpx;padding-left: 10rpx;" @click="openBimg(item.shaddress.annexes)">
  79. <uni-icons custom-prefix="custom-icon" color="#006AFF" type="home" size="28"></uni-icons>
  80. <label class="jiedanText">{{$t('order.menpaizp')}}</label>
  81. </view>
  82. <view class="contentColumnC" style="margin:20rpx;padding-left: 10rpx;" @click="Exchange(item.ddId,item.user)">
  83. <uni-icons custom-prefix="custom-icon" color="#006AFF" type="chatboxes" size="28"></uni-icons>
  84. <label class="jiedanText">{{$t('exchange.xinxi')}}</label>
  85. </view>
  86. <view class="contentColumnC" style="margin:20rpx;padding-left: 10rpx;" @click="imCall(item.ddId,item.user)">
  87. <uni-icons custom-prefix="custom-icon" color="#006AFF" type="phone" size="28"></uni-icons>
  88. <label class="jiedanText">IM Call</label>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import {
  96. setorderuzt,
  97. setLocat
  98. } from '@/pages/api/basic';
  99. export default {
  100. name:"orderItem",
  101. props:{
  102. orderList:'',
  103. qsId:''
  104. },
  105. data() {
  106. return {
  107. isAndroid:true
  108. };
  109. },
  110. mounted() {
  111. let systemInfo = uni.getSystemInfoSync();
  112. this.isAndroid = systemInfo.platform.toLowerCase() === 'android';
  113. console.log('mounted------------------')
  114. },
  115. methods:{
  116. youyouhui(obj){
  117. if(obj.mdSalesReduction){
  118. return true;
  119. }
  120. if(obj.mdDiscountAmount){
  121. return true;
  122. }
  123. if(obj.discountAmount){
  124. return true;
  125. }
  126. if(obj.salesReduction){
  127. return true;
  128. }
  129. return false;
  130. },
  131. getyhjr(obj){
  132. var jinr=0;
  133. if(obj.mdSalesReduction){
  134. jinr=obj.mdSalesReduction;
  135. }
  136. if(obj.mdDiscountAmount){
  137. jinr=jinr+obj.mdDiscountAmount;
  138. }
  139. if(obj.discountAmount){
  140. jinr=jinr+obj.discountAmount;
  141. }
  142. if(obj.salesReduction){
  143. jinr=jinr+obj.salesReduction;
  144. }
  145. jinr=parseInt(jinr);
  146. return '-'+this.$formPr(jinr)+this.$t('api.huobidanwei');
  147. },
  148. getStateStr(obj){
  149. if(obj.kefuState==0){
  150. return this.$t('order.kefujs');
  151. }
  152. else{
  153. if(obj.kefuRepeat==0){
  154. if(obj.kefuState==1){
  155. return this.$t('order.yishouli');
  156. }
  157. if(obj.kefuState==2){
  158. return this.$t('order.shouhwc');
  159. }
  160. }
  161. else{
  162. if(obj.repeatDdId){
  163. return this.$t('order.chongpaidd')+':'+obj.repeatDdId;
  164. }
  165. else{
  166. return this.$t('order.chongpaidd');
  167. }
  168. }
  169. }
  170. },
  171. gotoMsgList(obj){
  172. uni.navigateTo({
  173. url:'/pages/kehufuwu/kefuMsgList?ddId='+obj.ddId
  174. })
  175. },
  176. chakantp(obj){
  177. var data={
  178. id:'',
  179. img:'[]'
  180. }
  181. if(obj.sqImg){
  182. data.img=obj.sqImg;
  183. }
  184. uni.navigateTo({
  185. url:'/pages/index/GoodsImages?obj='+JSON.stringify(data)
  186. })
  187. },
  188. canopenBimg(mysrc){
  189. if(!mysrc){
  190. return false;
  191. }
  192. if(mysrc.length<8){
  193. return false;
  194. }
  195. return true;
  196. },
  197. openBimg(mysrc){
  198. if(!mysrc){
  199. return;
  200. }
  201. if(mysrc.length<8){
  202. return;
  203. }
  204. console.log(mysrc);
  205. uni.navigateTo({
  206. url:'/pages/index/BigimageView?mysrc='+mysrc
  207. })
  208. },
  209. jiedan(id){
  210. var online = getApp().globalData.isOnline;
  211. if(!online){
  212. uni.showToast({
  213. title: this.$t('user.xiaxianzh'),
  214. icon: 'none',
  215. duration: 2500
  216. })
  217. return;
  218. }
  219. if(this.qsId<=0 ||''==this.qsId){
  220. uni.showToast({
  221. title: this.$t('user.denglushixiao'),
  222. icon: 'none',
  223. duration: 2500
  224. })
  225. return;
  226. }
  227. this.setorderuzt(id,3)
  228. },
  229. quchan(id){
  230. this.setorderuzt(id,4)
  231. },
  232. wancheng(obj){
  233. if(obj.collectPayment==0){
  234. this.setorderuzt(obj.id,5);
  235. }
  236. else{
  237. var that = this;
  238. uni.showModal({
  239. title: that.$t('api.message'),
  240. content:that.$t('index.shoukuanwc'),
  241. confirmText:that.$t('index.queren'),
  242. cancelText:that.$t('index.quxiao'),
  243. success: function (res) {
  244. if (res.confirm) { //这里是点击了确定以后
  245. console.log('打电话')
  246. that.setorderuzt(obj.id,5)
  247. } else { //这里是点击了取消以后
  248. console.log('点击取消')
  249. }
  250. }
  251. })
  252. }
  253. },
  254. callPhone(telphone,user){
  255. var that = this;
  256. uni.showModal({
  257. title: that.$t('api.message'),
  258. content:that.$t('api.nqdbddh'),
  259. confirmText:that.$t('index.queren'),
  260. cancelText:that.$t('index.quxiao'),
  261. success: function (res) {
  262. if (res.confirm) { //这里是点击了确定以后
  263. console.log('打电话')
  264. plus.device.dial(telphone, false );
  265. } else { //这里是点击了取消以后
  266. console.log('点击取消')
  267. }
  268. }
  269. })
  270. },
  271. imCall(ddid,user){
  272. var data = {
  273. ddId:ddid,
  274. userId:user.userId,
  275. nickName:user.nickName,
  276. avatar:user.avatar,
  277. cid:user.cid
  278. }
  279. uni.setStorageSync('imUser',user);
  280. uni.navigateTo({
  281. url:'/pages/imcall/audioCall?caller=1'
  282. })
  283. },
  284. Exchange(ddid,user){
  285. console.log(ddid,user);
  286. var data = {
  287. ddId:ddid,
  288. userId:user.userId,
  289. nickName:user.nickName,
  290. avatar:user.avatar,
  291. cid:user.cid
  292. }
  293. uni.setStorageSync('imUser',data);
  294. // uni.navigateTo({
  295. // url:'/pages/imcall/ExchangeView?caller=1'
  296. // })
  297. uni.navigateTo({
  298. url:'/pages/imcall/GoeasyExchange?caller=1'
  299. })
  300. },
  301. async setorderuzt(rId,state,){
  302. var that = this;
  303. var data;
  304. if(state==3){
  305. data={
  306. id:rId,
  307. state:state,
  308. qsId:this.qsId
  309. }
  310. }
  311. else{
  312. data={
  313. id:rId,
  314. state:state,
  315. qsId:this.qsId,
  316. diningStatus:1
  317. }
  318. }
  319. await this.$http.post(`${setorderuzt}`,data,true)
  320. .then(async r => {
  321. console.log(r);
  322. this.$emit('ErefleshList');
  323. })
  324. .catch(err => {
  325. console.log(err)
  326. })
  327. },
  328. gotoNav(store){
  329. var navData={
  330. latitude:parseFloat(store.latitude),
  331. longitude:parseFloat(store.longitude),
  332. address:store.address
  333. }
  334. var temp = JSON.stringify(navData);
  335. uni.navigateTo({
  336. url:'/pages/map/mapboxView?navdata='+temp
  337. })
  338. //this.handlePosition(store.latitude,store.longitude,store.address);
  339. },
  340. },
  341. }
  342. </script>
  343. <style>
  344. @import '@/common/common.scss';
  345. @font-face {
  346. font-family: zrht;
  347. src: url('/uni_modules/font/zrht.otf');
  348. }
  349. .itemV{
  350. margin-top: 16rpx;
  351. background-color: white;
  352. }
  353. .psfnote{
  354. width: 92%;
  355. margin-left: 4%;
  356. margin-top: 5rpx;
  357. border-radius: 10rpx;
  358. background-color: crimson;
  359. }
  360. .spIcon{
  361. width: 90rpx;
  362. height: 90rpx;
  363. }
  364. .kouweisku{
  365. color:chocolate;
  366. padding-right: 12rpx;
  367. font-size: 28rpx;
  368. }
  369. .qiangdImg{
  370. width: 120rpx;
  371. height: 120rpx;
  372. }
  373. .quhuodian{
  374. font-size: 26rpx;
  375. padding: 8rpx;
  376. color: royalblue;
  377. border-radius: 16rpx;
  378. border: solid royalblue;
  379. }
  380. .shouhuodian{
  381. font-size: 26rpx;
  382. padding: 8rpx;
  383. color: crimson;
  384. border-radius: 16rpx;
  385. border: solid crimson;
  386. }
  387. .lineimag{
  388. display: flex;
  389. flex-direction: column;
  390. justify-content: space-between;
  391. margin-left: 45rpx;
  392. width: 4rpx;
  393. background-color: lightgray;
  394. height: 100rpx;
  395. margin-top: 4rpx;
  396. margin-bottom: 4rpx;
  397. }
  398. .yuandian{
  399. width: 16rpx;
  400. height: 16rpx;
  401. background-color: lightgray;
  402. border-radius: 8rpx;
  403. margin-left: -8rpx;
  404. }
  405. .timeText{
  406. font-size: 32rpx;
  407. color: #006AFF;
  408. padding-left: 20rpx;
  409. font-weight: bold;
  410. }
  411. .priceText{
  412. font-size: 30rpx;
  413. color: crimson;
  414. padding-right: 20rpx;
  415. }
  416. .titleText{
  417. font-size: 28rpx;
  418. /* font-family: zrht; */
  419. }
  420. .pnametext{
  421. overflow: hidden;
  422. text-overflow: ellipsis;
  423. display: -webkit-box;
  424. -webkit-line-clamp: 1;
  425. -webkit-box-orient: vertical;
  426. }
  427. .distenText{
  428. font-size: 26rpx;
  429. color: darkgray;
  430. padding-left: 20rpx;
  431. }
  432. .addrText{
  433. font-size: 28rpx;
  434. color: dimgray;
  435. }
  436. .stateText{
  437. font-size: 28rpx;
  438. color: darkgray;
  439. padding: 8rpx;
  440. border: solid darkgray;
  441. border-radius: 8rpx;
  442. }
  443. .noteText{
  444. margin-top: 16rpx;
  445. font-size: 28rpx;
  446. color: dimgray;
  447. padding: 8rpx;
  448. background-color: whitesmoke;
  449. border-radius: 8rpx;
  450. }
  451. .connectText{
  452. font-size: 28rpx;
  453. color: black;
  454. padding-left: 8rpx;
  455. padding-right: 8rpx;
  456. padding-top: 2rpx;
  457. padding-bottom: 2rpx;
  458. border: 2rpx solid darkgray;
  459. border-radius: 8rpx;
  460. }
  461. .setImg{
  462. width: 30rpx;
  463. height: 30rpx;
  464. }
  465. .setImgB{
  466. width: 40rpx;
  467. height: 40rpx;
  468. }
  469. .jiedanText{
  470. font-size: 24rpx;
  471. color: black;
  472. }
  473. .jiedanTextS{
  474. font-size: 20rpx;
  475. color: black;
  476. }
  477. .wanchengV{
  478. width: 480rpx;
  479. height: 68rpx;
  480. border-radius: 10rpx;
  481. background-color: crimson;
  482. }
  483. .wanchengT{
  484. padding-left: 20rpx;
  485. padding-right: 20rpx;
  486. line-height: 68rpx;
  487. font-weight: bold;
  488. font-size: 26rpx;
  489. color: white;
  490. border-radius: 10rpx;
  491. text-align: center;
  492. }
  493. .jiedanBtdf{
  494. padding: 10rpx;
  495. color:white;
  496. background-color: #1A1A1A;
  497. border-radius: 8rpx;
  498. box-shadow: 0rpx 0rpx 2rpx 0rpx #1A1A1A;
  499. }
  500. </style>