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

294 lines
5.9 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 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. type : 'tell',
  85. },
  86. {
  87. name: '达人同游',
  88. type : 'travel',
  89. },
  90. {
  91. name: '遗产路径',
  92. type : 'path',
  93. },
  94. {
  95. name: '我要跟拍',
  96. type : 'follow',
  97. },
  98. {
  99. name: '非遗体验',
  100. type : 'experience',
  101. },
  102. {
  103. name: '我要研学',
  104. type : 'Study',
  105. },
  106. {
  107. name: '文创好物',
  108. },
  109. ],
  110. type : [],
  111. mixinsListApi : 'queryCollectionList',
  112. options: [
  113. {
  114. text: '删除',
  115. style: {
  116. backgroundColor: '#FA5A0A'
  117. }
  118. },
  119. ],
  120. }
  121. },
  122. onLoad() {
  123. this.queryParams.collectionType = 0
  124. },
  125. onShow() {
  126. this.getData()
  127. },
  128. computed : {
  129. },
  130. methods: {
  131. leftClick(){
  132. uni.navigateBack(-1)
  133. },
  134. clickTabs({ index }){
  135. this.queryParams.collectionType = index
  136. this.getData()
  137. },
  138. toUrl(item){
  139. let type = this.tabs[item.collectionType].type
  140. if([0, 1, 3].includes(item.collectionType)){
  141. // 遗产讲述、达人同游、我要跟拍
  142. uni.navigateTo({
  143. url: `/pages_order/service/reservationDetail?type=${type}&id=` + item.id
  144. })
  145. }else if([2, 5].includes(item.collectionType)){
  146. // 遗产路径、我要研学
  147. uni.navigateTo({
  148. url: `/pages_order/service/StudyAndPathDetail?type=${type}&id=` + item.id
  149. })
  150. }else if([4].includes(item.collectionType)){
  151. // 非遗体验
  152. uni.navigateTo({
  153. url: `/pages_order/service/articleDetail?type=${type}&id=` + item.id
  154. })
  155. }else if([6].includes(item.collectionType)){
  156. // 文创好物
  157. uni.navigateTo({
  158. url: `/pages_order/product/productDetail?&id=` + item.id
  159. })
  160. }
  161. },
  162. delModel(item){
  163. let self = this
  164. uni.showModal({
  165. title: '确认删除吗?',
  166. success(r) {
  167. if(!r.confirm){
  168. return
  169. }
  170. self.$api('deleteCollection', {
  171. collectionId : item.id,
  172. collectionType : item.collectionType
  173. }, res => {
  174. self.getData()
  175. })
  176. }
  177. })
  178. },
  179. getData(){
  180. let queryParams = JSON.parse(JSON.stringify(this.queryParams))
  181. this.$api(this.mixinsListApi, queryParams,
  182. res => {
  183. uni.stopPullDownRefresh()
  184. if(res.code == 200){
  185. res.result.forEach(n => {
  186. n.collectionType = queryParams.collectionType
  187. })
  188. this.list = res.result
  189. }
  190. })
  191. },
  192. toPayUrl(item){
  193. let type = this.tabs[item.collectionType].type
  194. uni.navigateTo({
  195. url: `/pages_order/order/orderSubscribe?type=${type}&id=` + item.id
  196. })
  197. },
  198. }
  199. }
  200. </script>
  201. <style scoped lang="scss">
  202. .card {
  203. display: flex;
  204. width: 710rpx;
  205. margin: 40rpx 20rpx;
  206. align-items: center;
  207. position: relative;
  208. .iconx{
  209. position: absolute;
  210. top: 0rpx;
  211. right: 20rpx;
  212. }
  213. .card-img {
  214. height: 270rpx;
  215. width: 240rpx;
  216. flex-shrink: 0;
  217. image {
  218. height: 100%;
  219. width: 100%;
  220. border-radius: 20rpx;
  221. }
  222. }
  223. .card-content {
  224. margin-left: 3%;
  225. font-size: 28rpx;
  226. display: flex;
  227. flex-direction: column;
  228. justify-content: space-around;
  229. width: 97%;
  230. .title{
  231. max-width: 260rpx;
  232. }
  233. .card-content-img {
  234. display: flex;
  235. margin-left: 10rpx;
  236. width: 130rpx;
  237. height: 50rpx;
  238. }
  239. .card-content-tag {
  240. display: inline-block;
  241. font-size: 24rpx;
  242. padding: 2rpx 20rpx;
  243. border: 2rpx solid #FBA21E;
  244. background-color: #FFF1D2;
  245. color: #FBAF35;
  246. border-radius: 20rpx;
  247. width: fit-content;
  248. }
  249. .tips{
  250. font-size: 24rpx;
  251. color: #999;
  252. }
  253. .card-content-bottom {
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. .card-content-bottom-one {
  258. display: inline-block;
  259. color: #FFFDF6;
  260. background-color: #C83741;
  261. margin-right: 4%;
  262. padding: 12rpx 30rpx;
  263. border-radius: 40rpx;
  264. font-size: 24rpx;
  265. }
  266. }
  267. view {
  268. margin-top: 10rpx;
  269. }
  270. }
  271. }
  272. </style>