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

329 lines
6.4 KiB

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