index.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <view :data-theme="theme"
  3. :style="{ 'background-image': `linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 40%),url(${store.mer_banner})` }"
  4. class="store-detail">
  5. <tui-skeleton v-if="skeletonShow"></tui-skeleton>
  6. <view class="sectionBox">
  7. <view class="section head">
  8. <image :src="merchantAPPInfo.avatar"></image>
  9. <view class="text-wrap">
  10. <view class="name line1 acea-row row-middle">
  11. <text class="name_store">{{ merchantAPPInfo.name }}</text>
  12. <text v-if="store.typeId"
  13. class="merType ml8 bg-color">{{ store.typeId | merchantTypeFilter }}</text>
  14. <text v-else-if="store.isSelf" class="merType bg-color ml8">自营</text>
  15. </view>
  16. <view class="fans">
  17. {{ store.followerNum < 10000 ? store.followerNum + '人关注' : (store.followerNum / 10000).toFixed(2) + '万' + '人关注' }}
  18. </view>
  19. </view>
  20. <button hover-class="none" class="merCollect" :class="store.isCollect ? 'care' : ''"
  21. @click="followToggle">
  22. <text v-show="!store.isCollect" class="iconfont icon-guanzhu"></text>
  23. {{ store.isCollect ? '已关注' : '关注' }}
  24. </button>
  25. </view>
  26. <view class="section wrap">
  27. <view class="name">店铺评级</view>
  28. <view class="score-wrap">
  29. <view class="score">
  30. <view class='starsList'>
  31. <block v-for="(itemn, indexn) in merchantAPPInfo.starLevel" :key="indexn">
  32. <text class='iconfont icon-pingfen font-color'></text>
  33. </block>
  34. <block v-show="Number(merchantAPPInfo.starLevel)<5">
  35. <text v-for="(itemn, indexn) in (5-Number(merchantAPPInfo.starLevel))" :key="indexn"
  36. class='iconfont icon-pingfen' style="color: #BBBBBB;"></text>
  37. </block>
  38. <text class="font-color">{{merchantAPPInfo.starLevel}}</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="section wrap" @click="popupShow = true">
  44. <view class="name">店铺资质</view>
  45. <view><text class="iconfont icon-zizhizhengjian"></text></view>
  46. </view>
  47. <view class="section wrap" @click="call">
  48. <view class="name">联系客服</view>
  49. <view><text class="iconfont icon-kefu-mendian"></text></view>
  50. </view>
  51. <view class="section info">
  52. <view class="item very">
  53. <view class="name">店铺简介</view>
  54. <view class="value">{{ store.intro }}</view>
  55. </view>
  56. <view class="item very">
  57. <view class="acea-row" style="flex: 1;">
  58. <view class="name">店铺地址</view>
  59. <view class="value">{{ store.addressDetail }}</view>
  60. </view>
  61. <view v-if="store.latitude && store.longitude " class="iconfont icon-dingwei font-color"
  62. @click="showMaoLocation(store.latitude, store.longitude)"></view>
  63. </view>
  64. <view class="item">
  65. <view class="name">开店时间</view>
  66. <view class="value">{{ store.createTime | dateFormat }}</view>
  67. </view>
  68. </view>
  69. <view :class="{ mask: popupShow }" @click="popupShow = false"></view>
  70. <view :class="{ 'popup-active': popupShow }" class="popup-qrcode">
  71. <view class="name">资质图片</view>
  72. <template v-for="(item,index) in qualificationPicture">
  73. <image :src="item" @click='getpreviewImage(index)'></image>
  74. </template>
  75. </view>
  76. </view>
  77. </view>
  78. </template>
  79. <script>
  80. // +----------------------------------------------------------------------
  81. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  82. // +----------------------------------------------------------------------
  83. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  84. // +----------------------------------------------------------------------
  85. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  86. // +----------------------------------------------------------------------
  87. // | Author: CRMEB Team <admin@crmeb.com>
  88. // +----------------------------------------------------------------------
  89. import {
  90. mapGetters
  91. } from 'vuex';
  92. import {
  93. getMerDetailApi
  94. } from '@/api/merchant.js';
  95. import {
  96. chatConfig
  97. } from '@/utils/consumerType.js'
  98. import {
  99. followMer
  100. } from '@/libs/follow.js';
  101. import tuiSkeleton from '@/components/base/tui-skeleton.vue';
  102. let app = getApp();
  103. export default {
  104. computed: mapGetters(['isLogin', 'uid', 'merchantAPPInfo', 'merchantType']),
  105. components: {
  106. tuiSkeleton
  107. },
  108. data() {
  109. return {
  110. skeletonShow: true,
  111. merid: 0,
  112. store: {},
  113. score: 0,
  114. star: 0,
  115. popupShow: false,
  116. storeCode: '',
  117. openSettingBtnHidden: true, //是否授权
  118. qualificationPicture: [],
  119. theme: app.globalData.theme
  120. };
  121. },
  122. onLoad: function(options) {
  123. this.merid = options.merId;
  124. this.getStore();
  125. },
  126. onReady: function() {
  127. },
  128. mounted: function() {
  129. if(!this.merchantAPPInfo) this.getMerIndexInfo()
  130. },
  131. methods: {
  132. //商户信息
  133. async getMerIndexInfo() {
  134. let { data } = await getMerIndexInfoApi(this.merId)
  135. this.$store.commit('MERCHANTJINFO', data);
  136. },
  137. //查看地图
  138. showMaoLocation(lat, long) {
  139. if (!lat || !long)
  140. return this.$util.Tips({
  141. title: '请设置允许商城访问您的位置!'
  142. });
  143. //#ifdef H5
  144. if (this.$wechat.isWeixin() === true) {
  145. this.$wechat
  146. .seeLocation({
  147. latitude: Number(lat),
  148. longitude: Number(long),
  149. name: this.store.name,
  150. address: this.store.addressDetail ? this.store.addressDetail : ''
  151. })
  152. .then(res => {
  153. console.log('success');
  154. });
  155. } else {
  156. //#endif
  157. uni.openLocation({
  158. latitude: parseFloat(lat),
  159. longitude: parseFloat(long),
  160. scale: 8,
  161. geocode: true,
  162. name: this.store.name,
  163. address: this.store.addressDetail ? this.store.addressDetail : '',
  164. success: function(res) {
  165. console.log(res);
  166. }
  167. });
  168. // #ifdef H5
  169. }
  170. //#endif
  171. },
  172. // 设置是否关注
  173. followToggle: function() {
  174. if (this.isLogin === false) {
  175. toLogin();
  176. } else {
  177. followMer(this.store.isCollect, this.merid).then(() => {
  178. this.$set(this.store, 'isCollect', !this.store.isCollect);
  179. let merchantInfo = {
  180. ...this.merchantAPPInfo
  181. }
  182. merchantInfo.isCollect = !merchantInfo.isCollect
  183. this.$store.commit('MERCHANTJINFO', {
  184. ...merchantInfo
  185. });
  186. });
  187. }
  188. },
  189. returns() {
  190. uni.navigateBack()
  191. },
  192. call: function() {
  193. chatConfig(this.$Cache.getItem('merchantAPPInfo'));
  194. },
  195. getpreviewImage: function(indexw) {
  196. uni.previewImage({
  197. urls: this.qualificationPicture,
  198. current: this.qualificationPicture[indexw]
  199. });
  200. },
  201. getStore: function() {
  202. getMerDetailApi(this.merid).then(res => {
  203. let store = res.data;
  204. this.store = store;
  205. this.qualificationPicture = JSON.parse(store.qualificationPicture)
  206. this.score = (parseFloat(store.postage_score) + parseFloat(store.product_score) +
  207. parseFloat(store.service_score)) / 3;
  208. this.star = (this.score / 5) * 100;
  209. this.skeletonShow = false
  210. });
  211. }
  212. }
  213. };
  214. </script>
  215. <style lang="scss" scoped>
  216. .care {
  217. color: #666666 !important;
  218. border: 1px solid #CCCCCC;
  219. background: inherit !important;
  220. }
  221. .score {
  222. display: flex;
  223. align-items: center;
  224. margin-top: 8rpx;
  225. font-weight: 500;
  226. font-size: 24rpx;
  227. line-height: 1;
  228. .iconfont {
  229. font-size: 20rpx;
  230. }
  231. }
  232. .ml8 {
  233. margin-left: 8rpx;
  234. margin-right: 0;
  235. }
  236. .store-detail {
  237. background: left top/750rpx 360rpx no-repeat fixed;
  238. .sectionBox {
  239. padding: 30rpx 24rpx;
  240. }
  241. .section {
  242. border-radius: 20rpx;
  243. margin-bottom: 20rpx;
  244. background-color: #ffffff;
  245. }
  246. .head {
  247. display: flex;
  248. align-items: center;
  249. padding: 20rpx;
  250. image {
  251. width: 90rpx;
  252. height: 90rpx;
  253. border-radius: 6rpx;
  254. }
  255. .text-wrap {
  256. flex: 1;
  257. min-width: 0;
  258. margin-right: 20rpx;
  259. margin-left: 20rpx;
  260. line-height: 1;
  261. .name {
  262. font-weight: bold;
  263. font-size: 28rpx;
  264. color: #333;
  265. .name_store {
  266. display: inline-block;
  267. overflow: hidden;
  268. white-space: nowrap;
  269. text-overflow: ellipsis;
  270. max-width: 140px;
  271. }
  272. .isSelf {
  273. padding: 3rpx;
  274. border-radius: 6rpx;
  275. }
  276. }
  277. .fans {
  278. margin-top: 15rpx;
  279. font-weight: 500;
  280. font-size: 22rpx;
  281. color: #666666;
  282. }
  283. }
  284. .followed {
  285. border: 1rpx solid #bfbfbf;
  286. background: none;
  287. color: #999999;
  288. }
  289. }
  290. .wrap {
  291. display: flex;
  292. align-items: center;
  293. padding: 32rpx 20rpx;
  294. .name {
  295. flex: 1;
  296. min-width: 0;
  297. font-weight: 400;
  298. font-size: 28rpx;
  299. color: #282828;
  300. }
  301. .score-wrap {
  302. display: flex;
  303. align-items: center;
  304. font-weight: 500;
  305. font-size: 28rpx;
  306. }
  307. .iconfont {
  308. font-size: 36rpx;
  309. }
  310. .icon-pingfen {
  311. margin-right: 6rpx;
  312. font-size: 23rpx;
  313. color: #666666;
  314. }
  315. .active {
  316. @include main_bg_color(theme);
  317. }
  318. }
  319. .info {
  320. .item {
  321. display: flex;
  322. align-items: center;
  323. padding: 30rpx 20rpx;
  324. border: 1rpx solid #f5f5f5;
  325. font-weight: normal;
  326. font-size: 28rpx;
  327. color: #282828;
  328. justify-content: flex-start;
  329. .name {
  330. margin-right: 16rpx;
  331. // width: 176rpx;
  332. }
  333. .value {
  334. font-size: 30rpx;
  335. font-family: PingFangSC-Regular, PingFang SC;
  336. font-weight: 400;
  337. color: #999999;
  338. line-height: 40rpx;
  339. width: 486rpx;
  340. word-break: break-all;
  341. }
  342. }
  343. .very {
  344. .name {
  345. align-self: flex-start;
  346. }
  347. }
  348. }
  349. .popup-qrcode {
  350. position: fixed;
  351. top: 50%;
  352. left: 50%;
  353. z-index: 99;
  354. width: 544rpx;
  355. padding-top: 48rpx;
  356. padding-bottom: 36rpx;
  357. border-radius: 24rpx;
  358. background-color: #ffffff;
  359. transform: translate(-50%, -50%) scale(0);
  360. opacity: 0;
  361. transition: 0.3s;
  362. line-height: 1;
  363. text-align: center;
  364. color: #282828;
  365. .name {
  366. max-width: 90%;
  367. margin-right: auto;
  368. margin-left: auto;
  369. font-weight: bold;
  370. font-size: 32rpx;
  371. }
  372. .info {
  373. margin-top: 24rpx;
  374. font-weight: 500;
  375. font-size: 24rpx;
  376. }
  377. image {
  378. width: 110rpx;
  379. height: 110rpx;
  380. margin-top: 18rpx;
  381. }
  382. }
  383. .popup-active {
  384. transform: translate(-50%, -50%) scale(1);
  385. opacity: 1;
  386. }
  387. }
  388. </style>