瑶都万能墙
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.

359 lines
7.2 KiB

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