orderShop.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="box">
  3. <!-- <view class="topTIs">门店确认收货后,才可选择预约时间</view> -->
  4. <view class="shopbox">
  5. <view class="shopline" v-for="(item,index) in queryShopList">
  6. <view class="shoplineLeft">
  7. <image :src="item.photoPath" mode="" class="shopImg" v-if="item.photoPath"></image>
  8. <image src="../../static/img/noimg.png" mode="" class="shopImg" v-else></image>
  9. </view>
  10. <view class="shopright">
  11. <view class="shopTop">
  12. <view class="shopName">{{item.shopName}}</view>
  13. <image src="../../static/img/shopcall.png" mode="" class="shopCallImg"
  14. @click="call(item.mobilePhone)"></image>
  15. </view>
  16. <view class="brandsBg">
  17. <span class="shopScore1" v-if="item.shopScore">{{item.shopScore}}</span>
  18. <span class="shopScore2" v-if="item.shopScore">分</span>
  19. <span class="shopScore2" v-if="!item.shopScore">暂无评分</span>
  20. <view class="brands" v-if="item.brands" v-for="(barnd,index2) in item.brands.split(',')">{{barnd}}</view>
  21. </view>
  22. <view class="timeBg">
  23. <view class="shopTime"><span v-if="item.startTime">{{item.startTime}}</span> - <span
  24. v-if="item.endTime">{{item.endTime}}</span> </view>
  25. <span class="shopScore3">服务次数 {{item.sheetSum}}</span>
  26. </view>
  27. <view class="shopBottom">
  28. <view class="shopBottomLeft">
  29. <span v-if="item.distance&&item.distance!= '0.00'">{{item.distance}}km</span>
  30. <span class="shopaddress">{{item.address}}</span>
  31. </view>
  32. <view v-if="fromChangeStore == 'true'">
  33. <view class="grayBtn" v-if="item.shopId == oldShopID" >确定</view>
  34. <view v-else class="Btn" @click="ckshop(item)">确定</view>
  35. </view>
  36. <view v-else class="Btn" @click="ckshop(item)">确定</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. components: {
  46. },
  47. data() {
  48. return {
  49. orderData: '',
  50. currentMileage: '',
  51. location: '',
  52. queryShopList: [],
  53. fromChangeStore: '',
  54. oldShopID: '',
  55. brand:'',
  56. }
  57. },
  58. onShow() {
  59. },
  60. onLoad(opt) {
  61. this.orderData = opt.orderData;
  62. this.currentMileage = opt.currentMileage;
  63. this.location = uni.getStorageSync("locationCity");
  64. this.brand = opt.brand;
  65. this.getqueryShopList()
  66. this.fromChangeStore = opt.fromChangeStore;
  67. this.oldShopID = opt.oldShopID;
  68. },
  69. methods: {
  70. call(mobilePhone) {
  71. uni.makePhoneCall({
  72. phoneNumber: mobilePhone
  73. });
  74. },
  75. ckshop(item) {
  76. console.log(item)
  77. var that = this;
  78. if (that.fromChangeStore == 'true') {
  79. console.log('更换门店');
  80. // 从更换门店 进来
  81. uni.setStorage({
  82. key: 'changeStore',
  83. data: item,
  84. success: function() {
  85. uni.navigateBack({
  86. })
  87. }
  88. });
  89. } else {
  90. uni.setStorage({
  91. key: 'orderShop',
  92. data: item,
  93. success: function() {
  94. uni.navigateTo({
  95. url: 'confirmOrder?orderData=' + that.orderData + '&currentMileage=' +
  96. that.currentMileage
  97. })
  98. }
  99. });
  100. }
  101. },
  102. getqueryShopList() {
  103. uni.showLoading({});
  104. var params = {}
  105. if (this.location.lat) {
  106. params = {
  107. lat: this.location.lat,
  108. lng: this.location.lng,
  109. cityCode: this.location.cityCode,
  110. comprehensive: 1,
  111. brand:this.brand,
  112. }
  113. } else {
  114. params = {
  115. cityCode: this.location.cityCode,
  116. comprehensive: 1,
  117. brand:this.brand,
  118. }
  119. }
  120. this.$http('worldKeepCar/worldHome/getWorldShopInfoList', params, 'GET').then(res => {
  121. uni.hideLoading();
  122. this.queryShopList = res.data
  123. // 处理 undefined和null转为空白字符串
  124. this.queryShopList.forEach((item, index) => {
  125. for (const key in item) {
  126. item[key] = this.$praseStrEmpty(item[key])
  127. }
  128. })
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style scoped>
  135. .box {
  136. min-height: 100vh;
  137. background: #F4F5F7;
  138. padding: 20rpx 0;
  139. }
  140. .topTIs {
  141. font-size: 26rpx;
  142. text-align: center;
  143. color: #C8841C;
  144. height: 72rpx;
  145. background: #FFF7EB;
  146. line-height: 72rpx;
  147. margin-bottom: 20rpx;
  148. }
  149. .shopbox {
  150. padding: 0 16rpx;
  151. }
  152. .shopline {
  153. padding: 20rpx;
  154. background: #FFFFFF;
  155. border-radius: 10rpx;
  156. margin-top: 20rpx;
  157. display: flex;
  158. }
  159. .shopImg {
  160. width: 146rpx;
  161. height: 146rpx;
  162. border-radius: 10rpx;
  163. }
  164. .shopCallImg {
  165. width: 38rpx;
  166. height: 46rpx;
  167. }
  168. .shopTop {
  169. display: flex;
  170. justify-content: space-between;
  171. width: 510rpx;
  172. }
  173. .shopright {
  174. padding-left: 20rpx;
  175. }
  176. .shopName {
  177. font-size: 26rpx;
  178. color: #333333;
  179. line-height: 37rpx;
  180. width: 450rpx;
  181. white-space: nowrap;
  182. overflow: hidden;
  183. text-overflow: ellipsis;
  184. }
  185. .shopScore1 {
  186. font-size: 36rpx;
  187. color: #FF4F00;
  188. }
  189. .shopScore2 {
  190. font-size: 22rpx;
  191. color: #FF4F00;
  192. }
  193. .shopScore3 {
  194. font-size: 22rpx;
  195. color: #333333;
  196. padding-left: 20rpx;
  197. }
  198. .brandsBg {
  199. display: flex;
  200. align-items: center;
  201. }
  202. .brands {
  203. margin-left: 14rpx;
  204. height: 30rpx;
  205. font-size: 22rpx;
  206. color: #FF5800;
  207. line-height: 30rpx;
  208. border-radius: 4rpx;
  209. border: 1rpx solid #F25D24;
  210. }
  211. .timeBg {
  212. display: flex;
  213. align-items: center;
  214. padding-top: 10rpx;
  215. }
  216. .shopTime {
  217. color: #666666;
  218. font-size: 22rpx;
  219. }
  220. .Btn {
  221. width: 104rpx;
  222. height: 56rpx;
  223. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  224. border-radius: 6rpx;
  225. font-size: 26rpx;
  226. text-align: center;
  227. color: #FFFFFF;
  228. line-height: 56rpx;
  229. }
  230. .grayBtn {
  231. width: 104rpx;
  232. height: 56rpx;
  233. background-color: #CCCCCC;
  234. border-radius: 6rpx;
  235. font-size: 26rpx;
  236. text-align: center;
  237. color: #FFFFFF;
  238. line-height: 56rpx;
  239. }
  240. .shopBottom {
  241. display: flex;
  242. }
  243. .shopBottomLeft {
  244. width: 400rpx;
  245. font-size: 22rpx;
  246. color: #666666;
  247. line-height: 30rpx;
  248. padding-top: 10rpx;
  249. }
  250. .shopaddress {
  251. padding-left: 10rpx;
  252. }
  253. </style>