orderShop.vue 4.6 KB

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