景徳镇旅游微信小程序
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.

300 lines
6.0 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view>
  3. <navbar title="我的收藏" leftClick @leftClick="leftClick" />
  4. <view style="background-color: #fff;">
  5. <uv-tabs :list="tabs"
  6. lineColor="#B12026"
  7. lineHeight="8rpx"
  8. lineWidth="50rpx"
  9. @click="clickTabs"></uv-tabs>
  10. </view>
  11. <hList :list="list">
  12. <template
  13. v-slot="{item,index}"
  14. >
  15. <view class="card"
  16. @click="toUrl(item, tabs)"
  17. >
  18. <view class="card-img">
  19. <image :src="item.roleHead
  20. || item.amusementImage
  21. || item.experienceImage
  22. || item.waresImage" mode="aspectFill"></image>
  23. </view>
  24. <view class="iconx"
  25. @click.stop="delModel(item)">
  26. <uv-icon
  27. name="close-circle-fill"
  28. size="40rpx"
  29. color="#B12026"></uv-icon>
  30. </view>
  31. <view class="card-content">
  32. <view style="display: flex; align-items: center;">
  33. <view class="title text-ellipsis">{{ item.roleName
  34. || item.amusementTitle
  35. || item.experienceTitle
  36. || item.waresTitle }}</view>
  37. </view>
  38. <view class="card-content-tag"
  39. v-if="item.preTime || item.experienceOpentime">
  40. {{ item.preTime
  41. || item.experienceOpentime
  42. || '提前一周预约' }}
  43. </view>
  44. <view class="tips text-ellipsis-2"
  45. v-if="item.preInfo">
  46. {{ item.preInfo}}
  47. </view>
  48. <view class="card-content-bottom">
  49. <view style="color: #FF280C;">
  50. {{ item.price
  51. || item.amusementPrice
  52. || item.experiencePrice
  53. || item.waresPrice}}
  54. </view>
  55. <view class="card-content-bottom-one"
  56. v-if="item.collectionType != 6 &&
  57. item.collectionType != 2 || item.isPay == 1"
  58. @click.stop="toPayUrl(item)">
  59. 线上预约
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. </hList>
  66. </view>
  67. </template>
  68. <script>
  69. import mixinsList from '@/mixins/list.js'
  70. import hList from '@/components/list/h-list.vue'
  71. export default {
  72. components : {
  73. hList
  74. },
  75. mixins : [mixinsList],
  76. data() {
  77. return {
  78. tabs: [
  79. // {
  80. // name: '文化遗产',
  81. // },
  82. {
  83. name: '遗产讲述',
  84. toUrlType : 0,
  85. toPayUrlType : 1,
  86. },
  87. {
  88. name: '达人同游',
  89. toUrlType : 1,
  90. toPayUrlType : 2,
  91. },
  92. {
  93. name: '遗产路径',
  94. toUrlType : 0,
  95. toPayUrlType : 0,
  96. },
  97. {
  98. name: '我要跟拍',
  99. toUrlType : 2,
  100. toPayUrlType : 3,
  101. },
  102. {
  103. name: '非遗体验',
  104. toUrlType : 2,
  105. toPayUrlType : 4,
  106. },
  107. {
  108. name: '我要研学',
  109. toUrlType : 1,
  110. toPayUrlType : 5,
  111. },
  112. {
  113. name: '文创好物',
  114. },
  115. ],
  116. type : [],
  117. mixinsListApi : 'queryCollectionList',
  118. options: [
  119. {
  120. text: '删除',
  121. style: {
  122. backgroundColor: '#FA5A0A'
  123. }
  124. },
  125. ],
  126. }
  127. },
  128. onLoad() {
  129. this.queryParams.collectionType = 0
  130. },
  131. onShow() {
  132. this.getData()
  133. },
  134. computed : {
  135. },
  136. methods: {
  137. leftClick(){
  138. uni.navigateBack(-1)
  139. },
  140. clickTabs({ index }){
  141. this.queryParams.collectionType = index
  142. this.getData()
  143. },
  144. toUrl(item){
  145. let type = this.tabs[item.collectionType].toUrlType
  146. if([0, 1, 3].includes(item.collectionType)){
  147. // 遗产讲述、达人同游、我要跟拍
  148. uni.navigateTo({
  149. url: `/pages_order/service/reservationDetail?type=${type}&id=` + item.id
  150. })
  151. }else if([2, 5].includes(item.collectionType)){
  152. // 遗产路径、我要研学
  153. uni.navigateTo({
  154. url: `/pages_order/service/StudyAndPathDetail?type=${type}&id=` + item.id
  155. })
  156. }else if([4].includes(item.collectionType)){
  157. // 非遗体验
  158. uni.navigateTo({
  159. url: `/pages_order/service/articleDetail?type=${type}&id=` + item.id
  160. })
  161. }else if([6].includes(item.collectionType)){
  162. // 文创好物
  163. uni.navigateTo({
  164. url: `/pages_order/product/productDetail?&id=` + item.id
  165. })
  166. }
  167. },
  168. delModel(item){
  169. let self = this
  170. uni.showModal({
  171. title: '确认删除吗?',
  172. success(r) {
  173. if(!r.confirm){
  174. return
  175. }
  176. self.$api('deleteCollection', {
  177. collectionId : item.id,
  178. collectionType : item.collectionType
  179. }, res => {
  180. self.getData()
  181. })
  182. }
  183. })
  184. },
  185. getData(){
  186. let queryParams = JSON.parse(JSON.stringify(this.queryParams))
  187. this.$api(this.mixinsListApi, queryParams,
  188. res => {
  189. uni.stopPullDownRefresh()
  190. if(res.code == 200){
  191. res.result.forEach(n => {
  192. n.collectionType = queryParams.collectionType
  193. })
  194. this.list = res.result
  195. }
  196. })
  197. },
  198. toPayUrl(item){
  199. let type = this.tabs[item.collectionType].toPayUrlType
  200. uni.navigateTo({
  201. url: `/pages_order/order/orderSubscribe?payType=${type}&id=` + item.id
  202. })
  203. },
  204. }
  205. }
  206. </script>
  207. <style scoped lang="scss">
  208. .card {
  209. display: flex;
  210. width: 710rpx;
  211. margin: 40rpx 20rpx;
  212. align-items: center;
  213. position: relative;
  214. .iconx{
  215. position: absolute;
  216. top: 0rpx;
  217. right: 20rpx;
  218. }
  219. .card-img {
  220. height: 270rpx;
  221. width: 240rpx;
  222. flex-shrink: 0;
  223. image {
  224. height: 100%;
  225. width: 100%;
  226. border-radius: 20rpx;
  227. }
  228. }
  229. .card-content {
  230. margin-left: 3%;
  231. font-size: 28rpx;
  232. display: flex;
  233. flex-direction: column;
  234. justify-content: space-around;
  235. width: 97%;
  236. .title{
  237. max-width: 260rpx;
  238. }
  239. .card-content-img {
  240. display: flex;
  241. margin-left: 10rpx;
  242. width: 130rpx;
  243. height: 50rpx;
  244. }
  245. .card-content-tag {
  246. display: inline-block;
  247. font-size: 24rpx;
  248. padding: 2rpx 20rpx;
  249. border: 2rpx solid #FBA21E;
  250. background-color: #FFF1D2;
  251. color: #FBAF35;
  252. border-radius: 20rpx;
  253. width: fit-content;
  254. }
  255. .tips{
  256. font-size: 24rpx;
  257. color: #999;
  258. }
  259. .card-content-bottom {
  260. display: flex;
  261. justify-content: space-between;
  262. align-items: center;
  263. .card-content-bottom-one {
  264. display: inline-block;
  265. color: #FFFDF6;
  266. background-color: #C83741;
  267. margin-right: 4%;
  268. padding: 12rpx 30rpx;
  269. border-radius: 40rpx;
  270. font-size: 24rpx;
  271. }
  272. }
  273. view {
  274. margin-top: 10rpx;
  275. }
  276. }
  277. }
  278. </style>