index.vue 10.0 KB

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