store_options.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view>
  3. <!--components/store_options/store_options.wxml-->
  4. <template name="store_options_new">
  5. <view class="tcon">
  6. <image src="/static/pages/images/mbg.png" class="tcbg"></image>
  7. <view class="merchant ddflex" v-if="storeTemplate&&storeTemplate.state==0">
  8. <image :src="merchant.logo ? merchant.logo : about.CONFIG_INDEX_LOGO" mode="aspectFit" class="logo r50 bgfff"></image>
  9. <view class="fflex">
  10. <view class="ddflex">
  11. <view class="merchant-name tover">{{merchant.title ? merchant.title : '请选择门店'}}</view>
  12. <view class="change ddflex" @tap="merchantFun()" v-if="about.User_Limit_Store!=1&&about.Many_Store!=0">切换<image src="../../static/pages/images/change.png"></image></view>
  13. </view>
  14. <view class="merchant-info ddflex">
  15. <view class="li ddflex">
  16. <image src="../../static/pages/images/pinzhi.png"></image>高品低价
  17. </view>
  18. <view class="li ddflex">
  19. <image src="../../static/pages/images/pinzhi.png"></image>售后无忧
  20. </view>
  21. </view>
  22. </view>
  23. <button open-type="share" class="m-share"><image src="../../static/pages/images/share1.png"></image>分享</button>
  24. </view>
  25. <!-- <view class="topcon pdlr20" v-if="storeTemplate&&storeTemplate.state==0">
  26. <image :src="merchant.logo ? merchant.logo : about.CONFIG_INDEX_LOGO" mode="aspectFit" class="logo r50 bgfff mr20"></image>
  27. <view class="area flex" @tap="cloud=='default'?'':merchantFun()">
  28. <view class="areas f28 dflex">{{merchant.title ? merchant.title : '请选择门店'}}
  29. <image src="/static/pages/images/sanjiao.png" v-if="cloud!='default'&&about.User_Limit_Store!=1&&about.Many_Store!=0"></image>
  30. </view>
  31. <view class="cont dflex" v-if="cloud=='default'||about.User_Limit_Store==1">
  32. <view v-for="(item, index) in guarantee" :key="index" class="dflex li" v-if="index<3">
  33. <image src="/static/pages/images/guarantee.png"></image>{{item}}
  34. </view>
  35. </view>
  36. <view class="recent dflex" v-else>
  37. <text class="scolor bgfff">最近门店</text>
  38. <block v-if="merchant.range!=50000">
  39. {{merchant.range ? merchant.mDistance < 1000 ? merchant.mDistance+'m' : merchant.range+'km' : ''}}</block>
  40. </view>
  41. </view>
  42. <view class="renqi">{{merchant.person}}<text>人气</text></view>
  43. </view> -->
  44. <view class="top-nav" v-if="categoryList.length>0 && typeDistrictTemplate && typeDistrictTemplate.state==0">
  45. <scroll-view scroll-x="true">
  46. <block v-for="(item, index) in categoryList" :key="index">
  47. <navigator :url="'/product/list/list?id=' + item.id + '&title=' + item.title + '' + web" hover-class="none" class="li">{{item.title}}</navigator>
  48. </block>
  49. </scroll-view>
  50. <navigator url="/pages/sort/sort" open-type="switchTab" hover-class="none" class="column dflex"><image src="../../static/pages/images/nav.png"></image></navigator>
  51. </view>
  52. <view class="box1 bgfff pdlr20">
  53. <view v-if="sousuoTemplate&&sousuoTemplate.state==0" class="search dflex">
  54. <view class="dflex flex" @tap="search">
  55. <image src="/static/pages/images/ssico.png" class="ssico"></image>
  56. <view class="flex">搜索你想要的商品</view>
  57. </view>
  58. <!-- #ifndef H5 -->
  59. <image src="/static/pages/images/sao.png" @tap="saoma" class="sao"></image>
  60. <!-- #endif -->
  61. </view>
  62. </view>
  63. </view>
  64. <!-- <view class="box1 bgfff pdlr20"
  65. style="margin-top: {{merchant.id&&storeTemplate&&storeTemplate.state==0? '-52rpx' : 0}}">
  66. <view wx:if="{{sousuoTemplate&&sousuoTemplate.state==0}}" class="search dflex">
  67. <view class="dflex flex" bindtap="search">
  68. <image src="/pages/images/ssico.png" class="ssico"></image>
  69. <view class="flex">搜索你想要的商品</view>
  70. </view>
  71. <image src="/pages/images/sao.png" bindtap="saoma" class="sao"></image>
  72. </view>
  73. </view> -->
  74. <!-- <view class="box1 bgfff pdlr20" style="{{souShow?'margin-top: -28px':''}}" wx:if="{{souShow}}">
  75. </view> -->
  76. </template>
  77. </view>
  78. </template>
  79. <script>
  80. // components/store_options/store_options.js
  81. // 门店选择
  82. const app = getApp();
  83. const req = require("../../utils/request.js");
  84. const api = require("../../utils/api.js");
  85. const route = require("../../utils/route.js");
  86. export default {
  87. data() {
  88. return {
  89. categoryList: []
  90. };
  91. },
  92. components: {},
  93. props: {
  94. storeTemplate: Object, //门店配置
  95. merchant: Object, //门店
  96. about: Object, //参数配置
  97. // timelyTemplate: Object,
  98. guarantee: Array, //配置商城服务保障
  99. sousuoTemplate: Object, //搜索配置
  100. cloud:String, //荣康的是否默认门店
  101. web:String, //路由跳转
  102. url:String ,//路由跳转
  103. typeDistrictTemplate: Object //分类导航
  104. },
  105. watch: {
  106. },
  107. beforeMount() {},
  108. mounted() { // this.init()
  109. this.getCategory();
  110. // console.log(this.merchant,this.cloud,this.guarantee,this.storeTemplate,this.sousuoTemplate,this.timelyTemplate)
  111. },
  112. onPageShow() {},
  113. methods: {
  114. search() {
  115. // app.openPage('pages/search/search')
  116. app.globalData.openPage('pages/search/search'+this.url)
  117. },
  118. merchantFun() {
  119. if(this.about.User_Limit_Store==1||this.about.Many_Store==0){
  120. }else{
  121. app.globalData.openPage('merchant/nearby/nearby')
  122. }
  123. },
  124. saoma() {
  125. var _this = this;
  126. // #ifndef H5
  127. // 允许从相机和相册扫码
  128. uni.scanCode({
  129. success: (res) => {
  130. uni.navigateTo({
  131. url: '/' + res.path,
  132. })
  133. // this.scene = '1290926887903780865';
  134. this.loadCodeParams();
  135. }
  136. })
  137. // #endif
  138. },
  139. loadCodeParams() {
  140. let _ts = this;
  141. return new Promise((resolve, reject) => {
  142. if (!_ts.scene) {
  143. resolve();
  144. return false;
  145. }
  146. req.getRequest('/api/code/params', {
  147. scene: _ts.scene
  148. }, data => {
  149. req.setStorage('pidCode', data.userId);
  150. resolve();
  151. });
  152. });
  153. },
  154. getCategory() {
  155. //产品分类
  156. let that = this;
  157. route.getCategory({
  158. pid: 0
  159. }, res => {
  160. this.categoryList = res;
  161. });
  162. },
  163. }
  164. };
  165. </script>
  166. <style>
  167. @import "./store_options.css";
  168. </style>