orderItemC.vue 12 KB

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