瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

371 lines
7.5 KiB

1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
8 months ago
11 months ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
8 months ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
  1. <template>
  2. <view class="postDetail">
  3. <navbar leftClick @leftClick="$utils.navigateBack" title="详情" />
  4. <view class="works" @click="$emit('click')">
  5. <view class="box" :style="{'--sexcolor' : sex[detail.sex].color}">
  6. <view class="headPortraitimg">
  7. <image :src="detail.logoImage"
  8. @click.stop="previewImage([item.logoImage])"
  9. mode="aspectFill"></image>
  10. </view>
  11. <view class="YaoduUniversalWall">
  12. <view class="heide">
  13. <view class="username text-ellipsis">
  14. {{ detail.title }}
  15. </view>
  16. </view>
  17. <view class="Times">
  18. <view class="TimeMonth">
  19. 营业时间{{ detail.workTime }}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <addressSpot
  25. :address="detail.address"
  26. :latitude="detail.latitude"
  27. :longitude="detail.longitude"
  28. />
  29. <view class="bottom">
  30. <view class="browse">
  31. {{ detail.isBrowse }}浏览
  32. </view>
  33. <view class="browse">
  34. {{ detail.isComment }}条评论
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 分类 -->
  39. <view class="LabelOptions">
  40. <uv-tabs :list="category"
  41. :activeStyle="{color : '#000', fontWeight : 900}"
  42. lineColor="#5baaff"
  43. lineHeight="8rpx"
  44. lineWidth="50rpx"
  45. :scrollable="false"
  46. @click="tabsClick"></uv-tabs>
  47. </view>
  48. <!-- 商城美食 -->
  49. <view class="goodList"
  50. v-if="tagIndex == 0">
  51. <productSelectList
  52. v-if="detail.pay == 'Y'"
  53. :shopId="detail.id"
  54. :edit="detail.shopUser == userInfo.id"
  55. :detail="detail"
  56. @getData="getData"
  57. :list="list"/>
  58. <view v-else style="padding: 0 20rpx;">
  59. <productList
  60. :productList="list"
  61. @getData="getData"
  62. :edit="detail.shopUser == userInfo.id"
  63. :pay="detail.pay"/>
  64. </view>
  65. </view>
  66. <!-- 店铺介绍 -->
  67. <view class="goodInfo"
  68. v-if="tagIndex == 1">
  69. <view class="box" :style="{'--sexcolor' : sex[detail.sex].color}">
  70. <view class="headPortraitimg"
  71. v-if="detail.shopImage">
  72. <image :src="detail.shopImage"
  73. @click.stop="previewImage([item.shopImage])"
  74. mode="aspectFill"></image>
  75. </view>
  76. <view class="YaoduUniversalWall">
  77. <view class="heide"
  78. v-if="detail.shopName">
  79. <view class="username text-ellipsis">
  80. {{ detail.shopName }}
  81. </view>
  82. </view>
  83. <callPhone
  84. :phone="detail.shopPhone"
  85. type="3"
  86. :phoneTitle="detail.title"
  87. :pid="detail.id"
  88. title="联系店家" />
  89. <!-- 二维码入口 -->
  90. <view class="qrcode-btn" @click="goToQrCode">
  91. <uv-icon name="scan" size="30rpx" color="#3B5CF0"></uv-icon>
  92. <text>店铺二维码</text>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="dynamics"
  97. v-html="$utils.stringFormatHtml(detail.title)">
  98. </view>
  99. <view class="Artworkimages">
  100. <view class="wrokimg" @click.stop="previewImage(detail.detailsImage, i)" :key="i"
  101. v-for="(img, i) in detail.detailsImage">
  102. <image :src="img" mode="aspectFill"></image>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 评论组件 -->
  107. <commentList
  108. v-if="tagIndex == 2"
  109. @getData="getData"
  110. :list="list"
  111. :params="params"
  112. />
  113. </view>
  114. </template>
  115. <script>
  116. import mixinsSex from '@/mixins/sex.js'
  117. import mixinsList from '@/mixins/list.js'
  118. import commentList from '../components/list/comment/commentList.vue'
  119. // import goodList from '../components/list/gourmet/goodList.vue'
  120. import productSelectList from '../components/list/gourmet/productSelectList.vue'
  121. import productList from '@/components/user/productList.vue'
  122. export default {
  123. mixins: [mixinsSex, mixinsList],
  124. components: {
  125. commentList,
  126. productSelectList,
  127. productList,
  128. },
  129. data() {
  130. return {
  131. category : [
  132. {
  133. name : '美食商城',
  134. value : 0,
  135. },
  136. {
  137. name : '店铺介绍',
  138. value : 1,
  139. },
  140. {
  141. name : '店铺评论',
  142. value : 2,
  143. },
  144. ],
  145. detail: {},
  146. // mixinsListApi : 'getCommentPage',//评论
  147. mixinsListApi : 'getGoodsList',//美食
  148. params : {
  149. type : '4',
  150. orderId : '',
  151. name : '',
  152. },
  153. id : 0,
  154. tagIndex : 0,
  155. }
  156. },
  157. onLoad(options) {
  158. // this.$route.query的参数
  159. console.log(options)
  160. this.id = options.id
  161. this.queryParams.type = this.params.type
  162. this.queryParams.orderId = options.id
  163. this.params.orderId = options.id
  164. this.queryParams.shopId = options.id
  165. // 设置分享路径
  166. this.share.path = '/pages_order/gourmet/gourmetDetail?id=' + this.id
  167. },
  168. onPullDownRefresh() {
  169. this.getDetail()
  170. },
  171. onShow() {
  172. this.getDetail()
  173. },
  174. methods: {
  175. // 跳转到二维码页面
  176. goToQrCode() {
  177. uni.navigateTo({
  178. url: `/pages_order/gourmet/qrCode?id=${this.id}`
  179. });
  180. },
  181. tabsClick(item) {
  182. this.tagIndex = item.value
  183. if(this.tagIndex == 0){
  184. this.list = []
  185. this.mixinsListApi = 'getGoodsList'
  186. }else if(this.tagIndex == 2){
  187. this.list = []
  188. this.mixinsListApi = 'getCommentPage'
  189. }
  190. this.getData()
  191. },
  192. getDetail() {
  193. this.$api('getStoreDetail', {
  194. id: this.id
  195. }, res => {
  196. uni.stopPullDownRefresh()
  197. if (res.code == 200) {
  198. this.params.name = res.result.title
  199. // res.result.image =
  200. // res.result.image ?
  201. // res.result.image.split(',') : [],
  202. res.result.detailsImage =
  203. res.result.detailsImage ?
  204. res.result.detailsImage.split(',') : [],
  205. // res.result.details =
  206. // res.result.details ?
  207. // res.result.details.split(',') : []
  208. this.detail = res.result
  209. // 设置分享信息
  210. this.share.title = res.result.title || '美食详情'
  211. this.share.imageUrl = this.$utils.getImageOne(res.result.logoImage)
  212. }
  213. })
  214. },
  215. }
  216. }
  217. </script>
  218. <style lang="scss" scoped>
  219. .postDetail {
  220. padding-bottom: calc(env(safe-area-inset-bottom) + 200rpx);
  221. .box {
  222. display: flex;
  223. align-items: center;
  224. .headPortraitimg {
  225. width: 100rpx;
  226. height: 100rpx;
  227. border-radius: 15rpx;
  228. overflow: hidden;
  229. image {
  230. width: 100%;
  231. height: 100%;
  232. }
  233. }
  234. .YaoduUniversalWall {
  235. padding: 0rpx 10rpx;
  236. .Times {
  237. display: flex;
  238. padding: 5rpx 0rpx;
  239. font-size: 20rpx;
  240. margin-top: 10rpx;
  241. .Month {
  242. margin: 0rpx 15rpx;
  243. }
  244. }
  245. }
  246. }
  247. .works {
  248. background-color: #fff;
  249. padding: 40rpx;
  250. border-radius: 20rpx;
  251. .personalInformation {
  252. display: flex;
  253. .inde {
  254. font-size: 25rpx;
  255. padding: 0rpx 8rpx;
  256. }
  257. .authentication {
  258. font-size: 25rpx;
  259. }
  260. }
  261. .bottom {
  262. display: flex;
  263. margin-top: 20rpx;
  264. font-size: 24rpx;
  265. .browse {
  266. margin: 0rpx 30rpx;
  267. color: rgb(132, 132, 132);
  268. }
  269. .Leavingamessage {
  270. margin-left: auto;
  271. display: flex;
  272. align-items: center;
  273. }
  274. }
  275. }
  276. .LabelOptions{
  277. background-color: #fff;
  278. }
  279. .goodList{
  280. // padding: 0 20rpx;
  281. }
  282. .goodInfo{
  283. margin: 20rpx;
  284. padding: 20rpx;
  285. background-color: #fff;
  286. border-radius: 30rpx;
  287. .qrcode-btn {
  288. display: flex;
  289. align-items: center;
  290. background-color: #f0f5ff;
  291. padding: 10rpx 20rpx;
  292. border-radius: 30rpx;
  293. margin-top: 15rpx;
  294. text {
  295. font-size: 24rpx;
  296. color: #3B5CF0;
  297. margin-left: 10rpx;
  298. }
  299. }
  300. .dynamics {
  301. margin-top: 20rpx;
  302. font-size: 28rpx;
  303. letter-spacing: 3rpx;
  304. }
  305. .Artworkimages {
  306. display: flex;
  307. flex-wrap: wrap;
  308. .wrokimg {
  309. margin: 10rpx;
  310. image {
  311. height: 190rpx;
  312. width: 190rpx;
  313. border-radius: 20rpx;
  314. }
  315. }
  316. }
  317. }
  318. }
  319. </style>