orderItemC.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  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="item.activity" class="contentInRowL" style="margin-left:20rpx;">
  17. <text class="titleText">{{$t('index.youhuiq')}}:</text>
  18. <text class="titleText" style="padding-left: 20rpx;">{{item.activity.salesName}}</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="item.activity" class="contentColumnC psfnote">
  60. <text v-if="item.activity.salesType==0" 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. <uni-popup style="z-index: 9999;" ref="popNav" type="center" :isMaskClick="true" :safeArea="true">
  93. <disanfanfNav :lat="lat" :lon="lon" :cityName="addrName" v-on:ENavOpen="NavOpen"></disanfanfNav>
  94. </uni-popup>
  95. </view>
  96. </template>
  97. <script>
  98. import {
  99. setorderuzt,
  100. setLocat
  101. } from '@/pages/api/basic';
  102. export default {
  103. name:"orderItem",
  104. props:{
  105. orderList:'',
  106. qsId:''
  107. },
  108. data() {
  109. return {
  110. isAndroid:true,
  111. lat:0,
  112. lon:0,
  113. addrName:''
  114. };
  115. },
  116. mounted() {
  117. let systemInfo = uni.getSystemInfoSync();
  118. this.isAndroid = systemInfo.platform.toLowerCase() === 'android';
  119. console.log('mounted------------------')
  120. },
  121. methods:{
  122. getStateStr(obj){
  123. if(obj.kefuState==0){
  124. return this.$t('order.kefujs');
  125. }
  126. else{
  127. if(obj.kefuRepeat==0){
  128. if(obj.kefuState==1){
  129. return this.$t('order.yishouli');
  130. }
  131. if(obj.kefuState==2){
  132. return this.$t('order.shouhwc');
  133. }
  134. }
  135. else{
  136. if(obj.repeatDdId){
  137. return this.$t('order.chongpaidd')+':'+obj.repeatDdId;
  138. }
  139. else{
  140. return this.$t('order.chongpaidd');
  141. }
  142. }
  143. }
  144. },
  145. gotoMsgList(obj){
  146. uni.navigateTo({
  147. url:'/pages/kehufuwu/kefuMsgList?ddId='+obj.ddId
  148. })
  149. },
  150. chakantp(obj){
  151. var data={
  152. id:'',
  153. img:'[]'
  154. }
  155. if(obj.sqImg){
  156. data.img=obj.sqImg;
  157. }
  158. uni.navigateTo({
  159. url:'/pages/index/GoodsImages?obj='+JSON.stringify(data)
  160. })
  161. },
  162. canopenBimg(mysrc){
  163. if(!mysrc){
  164. return false;
  165. }
  166. if(mysrc.length<8){
  167. return false;
  168. }
  169. return true;
  170. },
  171. openBimg(mysrc){
  172. if(!mysrc){
  173. return;
  174. }
  175. if(mysrc.length<8){
  176. return;
  177. }
  178. console.log(mysrc);
  179. uni.navigateTo({
  180. url:'/pages/index/BigimageView?mysrc='+mysrc
  181. })
  182. },
  183. jiedan(id){
  184. var online = getApp().globalData.isOnline;
  185. if(!online){
  186. uni.showToast({
  187. title: this.$t('user.xiaxianzh'),
  188. icon: 'none',
  189. duration: 2500
  190. })
  191. return;
  192. }
  193. if(this.qsId<=0 ||''==this.qsId){
  194. uni.showToast({
  195. title: this.$t('user.denglushixiao'),
  196. icon: 'none',
  197. duration: 2500
  198. })
  199. return;
  200. }
  201. this.setorderuzt(id,3)
  202. },
  203. quchan(id){
  204. this.setorderuzt(id,4)
  205. },
  206. wancheng(obj){
  207. if(obj.collectPayment==0){
  208. this.setorderuzt(obj.id,5);
  209. }
  210. else{
  211. var that = this;
  212. uni.showModal({
  213. title: that.$t('api.message'),
  214. content:that.$t('index.shoukuanwc'),
  215. confirmText:that.$t('index.queren'),
  216. cancelText:that.$t('index.quxiao'),
  217. success: function (res) {
  218. if (res.confirm) { //这里是点击了确定以后
  219. console.log('打电话')
  220. that.setorderuzt(obj.id,5)
  221. } else { //这里是点击了取消以后
  222. console.log('点击取消')
  223. }
  224. }
  225. })
  226. }
  227. },
  228. callPhone(telphone,user){
  229. var that = this;
  230. uni.showModal({
  231. title: that.$t('api.message'),
  232. content:that.$t('api.nqdbddh'),
  233. confirmText:that.$t('index.queren'),
  234. cancelText:that.$t('index.quxiao'),
  235. success: function (res) {
  236. if (res.confirm) { //这里是点击了确定以后
  237. console.log('打电话')
  238. plus.device.dial(telphone, false );
  239. } else { //这里是点击了取消以后
  240. console.log('点击取消')
  241. }
  242. }
  243. })
  244. },
  245. imCall(ddid,user){
  246. var data = {
  247. ddId:ddid,
  248. userId:user.userId,
  249. nickName:user.nickName,
  250. avatar:user.avatar,
  251. cid:user.cid
  252. }
  253. uni.setStorageSync('imUser',user);
  254. uni.navigateTo({
  255. url:'/pages/imcall/audioCall?caller=1'
  256. })
  257. },
  258. Exchange(ddid,user){
  259. console.log(ddid,user);
  260. var data = {
  261. ddId:ddid,
  262. userId:user.userId,
  263. nickName:user.nickName,
  264. avatar:user.avatar,
  265. cid:user.cid
  266. }
  267. uni.setStorageSync('imUser',data);
  268. // uni.navigateTo({
  269. // url:'/pages/imcall/ExchangeView?caller=1'
  270. // })
  271. uni.navigateTo({
  272. url:'/pages/imcall/GoeasyExchange?caller=1'
  273. })
  274. },
  275. async setorderuzt(rId,state,){
  276. var that = this;
  277. var data;
  278. if(state==3){
  279. data={
  280. id:rId,
  281. state:state,
  282. qsId:this.qsId
  283. }
  284. }
  285. else{
  286. data={
  287. id:rId,
  288. state:state,
  289. qsId:this.qsId,
  290. diningStatus:1
  291. }
  292. }
  293. await this.$http.post(`${setorderuzt}`,data,true)
  294. .then(async r => {
  295. console.log(r);
  296. this.$emit('ErefleshList');
  297. })
  298. .catch(err => {
  299. console.log(err)
  300. })
  301. },
  302. gotoNav(store){
  303. this.lat = store.latitude;
  304. this.lon = store.longitude;
  305. this.addrName = store.address;
  306. this.$refs.popNav.open('center');
  307. return;
  308. var navData={
  309. latitude:store.latitude,
  310. longitude:store.longitude,
  311. address:store.address
  312. }
  313. var temp = JSON.stringify(navData);
  314. uni.navigateTo({
  315. url:'/pages/map/mapboxView?navdata='+temp
  316. })
  317. //this.handlePosition(store.latitude,store.longitude,store.address);
  318. },
  319. NavOpen(){
  320. this.$refs.popNav.close();
  321. },
  322. },
  323. }
  324. </script>
  325. <style>
  326. @import '@/common/common.scss';
  327. @font-face {
  328. font-family: zrht;
  329. src: url('/uni_modules/font/zrht.otf');
  330. }
  331. .itemV{
  332. margin-top: 16rpx;
  333. background-color: white;
  334. }
  335. .psfnote{
  336. width: 92%;
  337. margin-left: 4%;
  338. margin-top: 5rpx;
  339. border-radius: 10rpx;
  340. background-color: crimson;
  341. }
  342. .spIcon{
  343. width: 90rpx;
  344. height: 90rpx;
  345. }
  346. .kouweisku{
  347. color:chocolate;
  348. padding-right: 12rpx;
  349. font-size: 28rpx;
  350. }
  351. .qiangdImg{
  352. width: 120rpx;
  353. height: 120rpx;
  354. }
  355. .quhuodian{
  356. font-size: 26rpx;
  357. padding: 8rpx;
  358. color: royalblue;
  359. border-radius: 16rpx;
  360. border: solid royalblue;
  361. }
  362. .shouhuodian{
  363. font-size: 26rpx;
  364. padding: 8rpx;
  365. color: crimson;
  366. border-radius: 16rpx;
  367. border: solid crimson;
  368. }
  369. .lineimag{
  370. display: flex;
  371. flex-direction: column;
  372. justify-content: space-between;
  373. margin-left: 45rpx;
  374. width: 4rpx;
  375. background-color: lightgray;
  376. height: 100rpx;
  377. margin-top: 4rpx;
  378. margin-bottom: 4rpx;
  379. }
  380. .yuandian{
  381. width: 16rpx;
  382. height: 16rpx;
  383. background-color: lightgray;
  384. border-radius: 8rpx;
  385. margin-left: -8rpx;
  386. }
  387. .timeText{
  388. font-size: 32rpx;
  389. color: #006AFF;
  390. padding-left: 20rpx;
  391. font-weight: bold;
  392. }
  393. .priceText{
  394. font-size: 30rpx;
  395. color: crimson;
  396. padding-right: 20rpx;
  397. }
  398. .titleText{
  399. font-size: 28rpx;
  400. /* font-family: zrht; */
  401. }
  402. .pnametext{
  403. overflow: hidden;
  404. text-overflow: ellipsis;
  405. display: -webkit-box;
  406. -webkit-line-clamp: 1;
  407. -webkit-box-orient: vertical;
  408. }
  409. .distenText{
  410. font-size: 26rpx;
  411. color: darkgray;
  412. padding-left: 20rpx;
  413. }
  414. .addrText{
  415. font-size: 28rpx;
  416. color: dimgray;
  417. }
  418. .stateText{
  419. font-size: 28rpx;
  420. color: darkgray;
  421. padding: 8rpx;
  422. border: solid darkgray;
  423. border-radius: 8rpx;
  424. }
  425. .noteText{
  426. margin-top: 16rpx;
  427. font-size: 28rpx;
  428. color: dimgray;
  429. padding: 8rpx;
  430. background-color: whitesmoke;
  431. border-radius: 8rpx;
  432. }
  433. .connectText{
  434. font-size: 28rpx;
  435. color: black;
  436. padding-left: 8rpx;
  437. padding-right: 8rpx;
  438. padding-top: 2rpx;
  439. padding-bottom: 2rpx;
  440. border: 2rpx solid darkgray;
  441. border-radius: 8rpx;
  442. }
  443. .setImg{
  444. width: 30rpx;
  445. height: 30rpx;
  446. }
  447. .setImgB{
  448. width: 40rpx;
  449. height: 40rpx;
  450. }
  451. .jiedanText{
  452. font-size: 24rpx;
  453. color: black;
  454. }
  455. .jiedanTextS{
  456. font-size: 20rpx;
  457. color: black;
  458. }
  459. .wanchengV{
  460. width: 480rpx;
  461. height: 68rpx;
  462. border-radius: 10rpx;
  463. background-color: crimson;
  464. }
  465. .wanchengT{
  466. padding-left: 20rpx;
  467. padding-right: 20rpx;
  468. line-height: 68rpx;
  469. font-weight: bold;
  470. font-size: 26rpx;
  471. color: white;
  472. border-radius: 10rpx;
  473. text-align: center;
  474. }
  475. .jiedanBtdf{
  476. padding: 10rpx;
  477. color:white;
  478. background-color: #1A1A1A;
  479. border-radius: 8rpx;
  480. box-shadow: 0rpx 0rpx 2rpx 0rpx #1A1A1A;
  481. }
  482. </style>