orderShop.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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="shopScore11" 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. <nodata v-if="queryShopList.length<1"></nodata>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import nodata from '@/components/nodata/nodata.vue'
  46. export default {
  47. components: {
  48. nodata
  49. },
  50. data() {
  51. return {
  52. orderData: '',
  53. currentMileage: '',
  54. location: '',
  55. queryShopList: [],
  56. fromChangeStore: '',
  57. oldShopID: '',
  58. brand:'',
  59. }
  60. },
  61. onShow() {
  62. },
  63. onLoad(opt) {
  64. this.orderData = opt.orderData;
  65. this.currentMileage = opt.currentMileage;
  66. var selectCity = uni.getStorageSync("selectCity");
  67. var dingw = uni.getStorageSync("locationCity")
  68. if(selectCity){
  69. var objdata={
  70. cityCode:selectCity.code,
  71. cityName:selectCity.city,
  72. }
  73. if(dingw.cityName==selectCity.city){
  74. objdata.lat=dingw.lat
  75. objdata.lng=dingw.lng
  76. }
  77. this.location=objdata
  78. }else{
  79. this.location = uni.getStorageSync("locationCity");
  80. }
  81. this.brand = opt.brand;
  82. this.getqueryShopList()
  83. this.fromChangeStore = opt.fromChangeStore;
  84. this.oldShopID = opt.oldShopID;
  85. },
  86. methods: {
  87. call(mobilePhone) {
  88. uni.makePhoneCall({
  89. phoneNumber: mobilePhone
  90. });
  91. },
  92. ckshop(item) {
  93. console.log(item)
  94. var that = this;
  95. if (that.fromChangeStore == 'true') {
  96. console.log('更换门店');
  97. // 从更换门店 进来
  98. uni.setStorage({
  99. key: 'changeStore',
  100. data: item,
  101. success: function() {
  102. uni.navigateBack({
  103. })
  104. }
  105. });
  106. } else {
  107. uni.setStorage({
  108. key: 'orderShop',
  109. data: item,
  110. success: function() {
  111. uni.navigateTo({
  112. url: 'confirmOrder?orderData=' + that.orderData + '&currentMileage=' +
  113. that.currentMileage
  114. })
  115. }
  116. });
  117. }
  118. },
  119. getqueryShopList() {
  120. uni.showLoading({
  121. title: '加载中'
  122. })
  123. var params = {}
  124. if (this.location.lat) {
  125. params = {
  126. lat: this.location.lat,
  127. lng: this.location.lng,
  128. cityCode: this.location.cityCode,
  129. comprehensive: 1,
  130. brand:this.brand,
  131. }
  132. } else {
  133. params = {
  134. cityCode: this.location.cityCode,
  135. comprehensive: 1,
  136. brand:this.brand,
  137. }
  138. }
  139. this.$http('worldKeepCar/worldHome/getWorldShopInfoList', params, 'GET').then(res => {
  140. uni.hideLoading();
  141. this.queryShopList = res.data
  142. // 处理 undefined和null转为空白字符串
  143. this.queryShopList.forEach((item, index) => {
  144. for (const key in item) {
  145. item[key] = this.$praseStrEmpty(item[key])
  146. }
  147. })
  148. })
  149. },
  150. }
  151. }
  152. </script>
  153. <style scoped>
  154. .box {
  155. min-height: 100vh;
  156. background: #F4F5F7;
  157. padding: 20rpx 0;
  158. }
  159. .topTIs {
  160. font-size: 26rpx;
  161. text-align: center;
  162. color: #C8841C;
  163. height: 72rpx;
  164. background: #FFF7EB;
  165. line-height: 72rpx;
  166. margin-bottom: 20rpx;
  167. }
  168. .shopbox {
  169. padding: 0 16rpx;
  170. }
  171. .shopline {
  172. padding: 20rpx;
  173. background: #FFFFFF;
  174. border-radius: 10rpx;
  175. margin-top: 20rpx;
  176. display: flex;
  177. }
  178. .shopImg {
  179. width: 146rpx;
  180. height: 146rpx;
  181. border-radius: 10rpx;
  182. }
  183. .shopCallImg {
  184. width: 38rpx;
  185. height: 46rpx;
  186. }
  187. .shopTop {
  188. display: flex;
  189. justify-content: space-between;
  190. width: 510rpx;
  191. }
  192. .shopright {
  193. padding-left: 20rpx;
  194. }
  195. .shopName {
  196. font-size: 26rpx;
  197. color: #333333;
  198. line-height: 37rpx;
  199. width: 450rpx;
  200. white-space: nowrap;
  201. overflow: hidden;
  202. text-overflow: ellipsis;
  203. }
  204. .shopScore1 {
  205. font-size: 36rpx;
  206. font-weight: bold;
  207. color: #FF4F00;
  208. height: 50rpx;
  209. line-height: 50rpx;
  210. }
  211. .shopScore11{
  212. font-size: 22rpx;
  213. color: #FF4F00;
  214. margin-right: 14rpx;
  215. }
  216. .shopScore2 {
  217. font-size: 22rpx;
  218. color: #666666;
  219. margin-right: 14rpx;
  220. padding: 8rpx 0;
  221. }
  222. .shopScore3 {
  223. font-size: 22rpx;
  224. color: #333333;
  225. padding-left: 20rpx;
  226. }
  227. .brandsBg {
  228. display: flex;
  229. flex-wrap: wrap;
  230. align-items: center;
  231. overflow: hidden;
  232. height: 50rpx;
  233. }
  234. .brands {
  235. border-radius: 4rpx;
  236. padding: 0 5rpx;
  237. color: #F19D01;
  238. height: 28rpx;
  239. border: 1px solid #F19D01;
  240. margin-right: 5rpx;
  241. font-size: 20rpx;
  242. line-height: 28rpx;
  243. }
  244. .timeBg {
  245. display: flex;
  246. align-items: center;
  247. }
  248. .shopTime {
  249. color: #666666;
  250. font-size: 22rpx;
  251. }
  252. .Btn {
  253. width: 104rpx;
  254. height: 56rpx;
  255. background: #FF2400 linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  256. border-radius: 6rpx;
  257. font-size: 26rpx;
  258. text-align: center;
  259. color: #FFFFFF;
  260. line-height: 56rpx;
  261. }
  262. .grayBtn {
  263. width: 104rpx;
  264. height: 56rpx;
  265. background-color: #CCCCCC;
  266. border-radius: 6rpx;
  267. font-size: 26rpx;
  268. text-align: center;
  269. color: #FFFFFF;
  270. line-height: 56rpx;
  271. }
  272. .shopBottom {
  273. display: flex;
  274. }
  275. .shopBottomLeft {
  276. width: 400rpx;
  277. font-size: 22rpx;
  278. color: #666666;
  279. line-height: 30rpx;
  280. padding-top: 10rpx;
  281. }
  282. .shopaddress {
  283. padding-left: 10rpx;
  284. }
  285. </style>