Browse Source

修改小程序收藏表

zs 1 năm trước cách đây
mục cha
commit
cce3686b06
29 tập tin đã thay đổi với 544 bổ sung347 xóa
  1. 1 0
      pages/home/index.vue
  2. 1 0
      pagesHome/article/index.vue
  3. 19 3
      pagesHome/hotel/index.vue
  4. 14 2
      pagesHome/hotel/info.vue
  5. 17 3
      pagesHome/ticket/info.vue
  6. 19 3
      pagesHome/type/index.vue
  7. 14 2
      pagesHome/type/info.vue
  8. 130 72
      pagesIndex/collect/index.vue
  9. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map
  10. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/article/index.js.map
  11. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/index.js.map
  12. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/info.js.map
  13. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/index.js.map
  14. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/info.js.map
  15. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/type/index.js.map
  16. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/type/info.js.map
  17. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/collect/index.js.map
  18. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/like/index.js.map
  19. 1 0
      unpackage/dist/dev/mp-weixin/pages/home/index.js
  20. 1 0
      unpackage/dist/dev/mp-weixin/pagesHome/article/index.js
  21. 49 41
      unpackage/dist/dev/mp-weixin/pagesHome/hotel/index.js
  22. 41 91
      unpackage/dist/dev/mp-weixin/pagesHome/hotel/info.js
  23. 58 18
      unpackage/dist/dev/mp-weixin/pagesHome/ticket/info.js
  24. 48 39
      unpackage/dist/dev/mp-weixin/pagesHome/type/index.js
  25. 49 11
      unpackage/dist/dev/mp-weixin/pagesHome/type/info.js
  26. 53 40
      unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.js
  27. 3 1
      unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.json
  28. 1 1
      unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.wxml
  29. 15 10
      unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.wxss

+ 1 - 0
pages/home/index.vue

@@ -194,6 +194,7 @@
 					const form = {
 						user: that.user._id,
 						source: item._id,
+						source_type: "article",
 						type: '0',
 						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
 					}

+ 1 - 0
pagesHome/article/index.vue

@@ -261,6 +261,7 @@
 					const form = {
 						user: that.user._id,
 						source: info._id,
+						source_type: "article",
 						type: type,
 						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
 					}

+ 19 - 3
pagesHome/hotel/index.vue

@@ -33,6 +33,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	export default {
 		data() {
 			return {
@@ -96,7 +97,8 @@
 					is_use: '0',
 					status: '1'
 				}
-				const res = await that.$api(`/hotel`, 'GET', {
+				if (that.user._id) info.user = that.user._id
+				const res = await that.$api(`/hotel/hotel`, 'GET', {
 					...info,
 					...that.searchInfo
 				})
@@ -125,9 +127,23 @@
 				})
 			},
 			// 收藏
-			onClick() {
+			async onClick(item) {
 				const that = this;
-				console.log("收藏");
+				let res;
+				if (item.is_collect == false) {
+					const form = {
+						user: that.user._id,
+						source: item._id,
+						source_type: "hotel",
+						type: '1',
+						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					}
+					res = await that.$api(`/like`, 'POST', form);
+				} else res = await that.$api(`/like/${item.like}`, 'DELETE', {})
+				if (res.errcode == '0') {
+					that.clearPage();
+					that.search()
+				}
 			},
 			// 分页
 			toPage(e) {

+ 14 - 2
pagesHome/hotel/info.vue

@@ -87,6 +87,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	export default {
 		data() {
 			return {
@@ -206,9 +207,20 @@
 				}
 			},
 			// 收藏
-			onClick() {
+			async onClick(item) {
 				const that = this;
-				console.log("收藏");
+				let res;
+				if (item.is_collect == false) {
+					const form = {
+						user: that.user._id,
+						source: item._id,
+						source_type: "hotel",
+						type: '1',
+						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					}
+					res = await that.$api(`/like`, 'POST', form);
+				} else res = await that.$api(`/like/${item.like}`, 'DELETE', {})
+				if (res.errcode == '0') that.search()
 			},
 			// 分页
 			toPage(e) {

+ 17 - 3
pagesHome/ticket/info.vue

@@ -58,6 +58,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	export default {
 		data() {
 			return {
@@ -114,7 +115,9 @@
 			async search() {
 				const that = this;
 				if (that.id) {
-					const res = await that.$api(`/ticket/${that.id}`, 'GET', {})
+					const info = {}
+					if (that.user._id) info.user = that.user._id
+					const res = await that.$api(`/ticket/ticket${that.id}`, 'GET', info)
 					if (res.errcode == '0') {
 						const type = that.typeList.find(i => i.value == res.data.type)
 						if (type) res.data.zhType = type.label
@@ -139,9 +142,20 @@
 				}
 			},
 			// 收藏
-			onClick() {
+			async onClick(item) {
 				const that = this;
-				console.log("收藏");
+				let res;
+				if (item.is_collect == false) {
+					const form = {
+						user: that.user._id,
+						source: item._id,
+						source_type: "ticket",
+						type: '1',
+						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					}
+					res = await that.$api(`/like`, 'POST', form);
+				} else res = await that.$api(`/like/${item.like}`, 'DELETE', {})
+				if (res.errcode == '0') that.search()
 			},
 			// 预订
 			toBuy(item) {

+ 19 - 3
pagesHome/type/index.vue

@@ -32,6 +32,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	export default {
 		data() {
 			return {
@@ -95,7 +96,8 @@
 					is_use: '0',
 					type: that.type
 				}
-				const res = await that.$api(`/location`, 'GET', {
+				if (that.user._id) info.user = that.user._id
+				const res = await that.$api(`/location/location`, 'GET', {
 					...info,
 					...that.searchInfo
 				})
@@ -124,9 +126,23 @@
 				})
 			},
 			// 收藏
-			onClick(item) {
+			async onClick(item) {
 				const that = this;
-				console.log("收藏");
+				let res;
+				if (item.is_collect == false) {
+					const form = {
+						user: that.user._id,
+						source: item._id,
+						source_type: "location",
+						type: '1',
+						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					}
+					res = await that.$api(`/like`, 'POST', form);
+				} else res = await that.$api(`/like/${item.like}`, 'DELETE', {})
+				if (res.errcode == '0') {
+					that.clearPage();
+					that.search()
+				}
 			},
 			// 分页
 			toPage(e) {

+ 14 - 2
pagesHome/type/info.vue

@@ -54,6 +54,7 @@
 </template>
 
 <script>
+	import moment from 'moment';
 	export default {
 		data() {
 			return {
@@ -117,9 +118,20 @@
 				}
 			},
 			// 收藏
-			onClick() {
+			async onClick(item) {
 				const that = this;
-				console.log("收藏");
+				let res;
+				if (item.is_collect == false) {
+					const form = {
+						user: that.user._id,
+						source: item._id,
+						source_type: "location",
+						type: '1',
+						create_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+					}
+					res = await that.$api(`/like`, 'POST', form);
+				} else res = await that.$api(`/like/${item.like}`, 'DELETE', {})
+				if (res.errcode == '0') that.search()
 			},
 			// 查询其他信息
 			async searchOther() {

+ 130 - 72
pagesIndex/collect/index.vue

@@ -1,44 +1,73 @@
 <template>
 	<view class="main">
 		<view class="one">
-			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
-				<view class="list-scroll-view">
-					<!-- 瀑布流布局列表 -->
-					<view class="pubuBox">
-						<view class="pubuItem">
-							<view class="list" v-for="(item, index) in list" :key="index" @tap="toInfo(item)">
-								<image :src="item.file&&item.file.length>0?item.file[0].url:''" mode="widthFix">
-								</image>
-								<view class="title"> <!-- 这是没有高度的父盒子(下半部分) -->
-									<view class="title_1">{{ item.title||'暂无' }}</view>
-									<view class="title_2">
-										<view class="left">
-											{{item.contact_name||'暂无昵称'}}
-										</view>
-										<view class="right" @tap.stop="toLike(item)">
-											<text class="iconfont icon-shoucang"></text>
-											{{item.collect_num||'0'}}
+			<tabs :tabs="tabs" @tabsChange="tabsChange">
+				<view class="tabsList">
+					<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
+						<view class="list-scroll-view">
+							<!-- 瀑布流布局列表 -->
+							<view class="pubuBox">
+								<view class="pubuItem">
+									<view class="list" v-for="(item, index) in list" :key="index" @tap="toInfo(item)">
+										<image :src="item.file&&item.file.length>0?item.file[0].url:''" mode="widthFix">
+										</image>
+										<view class="title"> <!-- 这是没有高度的父盒子(下半部分) -->
+											<view class="title_1">{{ item.title ||item.name||'暂无'}}</view>
+											<view class="title_2">
+												<view class="left textOver">
+													{{item.contact_name||item.address||'暂无'}}
+												</view>
+												<view class="right" @tap.stop="toLike(item)">
+													<text class="iconfont icon-shoucang"></text>
+													{{item.collect_num||'0'}}
+												</view>
+											</view>
 										</view>
 									</view>
 								</view>
 							</view>
+							<view class="is_bottom" v-if="is_bottom">
+								<text>{{config.bottom_title||'到底了!'}}</text>
+							</view>
 						</view>
-					</view>
-					<view class="is_bottom" v-if="is_bottom">
-						<text>{{config.bottom_title||'到底了!'}}</text>
-					</view>
+					</scroll-view>
 				</view>
-			</scroll-view>
+			</tabs>
 		</view>
 	</view>
 </template>
 
 <script>
+	import tabs from '../../components/tabs/index.vue';
 	export default {
+		components: {
+			tabs
+		},
 		data() {
 			return {
 				config: {},
 				user: {},
+				tabs: {
+					active: 'article',
+					bgColor: '#ffffff',
+					menu: [{
+							title: '游玩攻略',
+							active: 'article'
+						},
+						{
+							title: '酒店民宿',
+							active: 'hotel'
+						},
+						{
+							title: '美食特色',
+							active: 'location'
+						},
+						{
+							title: '景区门票',
+							active: 'ticket'
+						}
+					]
+				},
 				list: [],
 				total: 0,
 				skip: 0,
@@ -99,6 +128,7 @@
 					skip: that.skip,
 					limit: that.limit,
 					user: that.user._id,
+					source_type: that.tabs.active,
 					type: '1'
 				}
 				const res = await that.$api(`/like/article`, 'GET', {
@@ -115,17 +145,39 @@
 					});
 				}
 			},
+			// 选择选项卡
+			tabsChange(e) {
+				const that = this;
+				that.$set(that.tabs, `active`, e.active)
+				that.clearPage();
+				that.search()
+			},
 			// 查看详情
 			toInfo(item) {
-				uni.navigateTo({
-					url: `/pagesHome/article/index?id=${item.id||item._id}`
-				})
+				const that = this;
+				if (that.tabs.active == 'article') {
+					uni.navigateTo({
+						url: `/pagesHome/article/index?id=${item.id||item._id}`
+					})
+				} else if (that.tabs.active == 'hotel') {
+					uni.navigateTo({
+						url: `/pagesHome/hotel/info?id=${item.id||item._id}`
+					})
+				} else if (that.tabs.active == 'location') {
+					uni.navigateTo({
+						url: `/pagesHome/type/info?id=${item.id||item._id}`
+					})
+				} else if (that.tabs.active == 'ticket') {
+					uni.navigateTo({
+						url: `/pagesHome/ticket/info?id=${item.id||item._id}`
+					})
+				}
 			},
-			// 取消收藏
+			// 取消点赞
 			async toLike(item) {
 				const that = this;
 				let res;
-				res = await that.$api(`/like/${item.collect}`, 'DELETE', {})
+				res = await that.$api(`/like/${item.like}`, 'DELETE', {})
 				if (res.errcode == '0') {
 					that.clearPage();
 					that.search()
@@ -181,60 +233,66 @@
 			background-color: var(--f9Color);
 			margin: 2vw 0 0 0;
 
-			.pubuBox {
-				padding: 2vw;
-			}
-
-			.pubuItem {
-				column-count: 2;
-				column-gap: 2vw;
-			}
+			.tabsList {
+				position: relative;
+				width: 100vw;
+				height: 90vh;
 
-			.list {
-				box-sizing: border-box;
-				border-radius: 2vw;
-				overflow: hidden;
-				background-color: var(--mainColor);
-				break-inside: avoid;
-				/*避免在元素内部插入分页符*/
-				box-sizing: border-box;
-				margin-bottom: 2vw;
-			}
-
-			.list image {
-				width: 100%;
-			}
+				.pubuBox {
+					padding: 2vw;
+				}
 
-			.title {
-				padding: 2vw;
+				.pubuItem {
+					column-count: 2;
+					column-gap: 2vw;
+				}
 
-				.title_1 {
-					font-size: var(--font14Size);
-					line-height: 4vw;
-					text-overflow: -o-ellipsis-lastline;
+				.list {
+					box-sizing: border-box;
+					border-radius: 2vw;
 					overflow: hidden;
-					text-overflow: ellipsis;
-					display: -webkit-box;
-					-webkit-line-clamp: 2;
-					line-clamp: 2;
-					-webkit-box-orient: vertical;
-					min-height: 6vw;
-					max-height: 20vw;
+					background-color: var(--mainColor);
+					break-inside: avoid;
+					/*避免在元素内部插入分页符*/
+					box-sizing: border-box;
+					margin-bottom: 2vw;
+				}
+
+				.list image {
+					width: 100%;
 				}
 
-				.title_2 {
-					display: flex;
-					justify-content: space-between;
-					font-size: var(--font12Size);
-					color: var(--f69Color);
-					padding: 1vw 0;
+				.title {
+					padding: 2vw;
 
-					.right {
+					.title_1 {
+						font-size: var(--font14Size);
+						line-height: 4.5vw;
+						text-overflow: -o-ellipsis-lastline;
+						overflow: hidden;
+						text-overflow: ellipsis;
+						display: -webkit-box;
+						-webkit-line-clamp: 2;
+						line-clamp: 2;
+						-webkit-box-orient: vertical;
+						min-height: 6vw;
+						max-height: 20vw;
+					}
+
+					.title_2 {
 						display: flex;
-						align-items: center;
+						justify-content: space-between;
+						font-size: var(--font12Size);
+						color: var(--f69Color);
+						padding: 1vw 0;
+
+						.right {
+							display: flex;
+							align-items: center;
 
-						text:first-child {
-							padding: 0 1vw 0 0;
+							text:first-child {
+								padding: 0 1vw 0 0;
+							}
 						}
 					}
 				}

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/article/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/hotel/info.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/ticket/info.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/type/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesHome/type/info.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/collect/index.js.map


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pagesIndex/like/index.js.map


+ 1 - 0
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -434,6 +434,7 @@ var _default = {
                 form = {
                   user: that.user._id,
                   source: item._id,
+                  source_type: "article",
                   type: '0',
                   create_time: (0, _moment.default)().format('YYYY-MM-DD HH:mm:ss')
                 };

+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/article/index.js

@@ -495,6 +495,7 @@ var _default = {
                 form = {
                   user: that.user._id,
                   source: info._id,
+                  source_type: "article",
                   type: type,
                   create_time: (0, _moment.default)().format('YYYY-MM-DD HH:mm:ss')
                 };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 49 - 41
unpackage/dist/dev/mp-weixin/pagesHome/hotel/index.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 41 - 91
unpackage/dist/dev/mp-weixin/pagesHome/hotel/info.js


+ 58 - 18
unpackage/dist/dev/mp-weixin/pagesHome/ticket/info.js

@@ -196,6 +196,7 @@ Object.defineProperty(exports, "__esModule", {
 exports.default = void 0;
 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
+var _moment = _interopRequireDefault(__webpack_require__(/*! moment */ 52));
 //
 //
 //
@@ -348,19 +349,21 @@ var _default = {
     search: function search() {
       var _this = this;
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
-        var that, res, type;
+        var that, info, res, type;
         return _regenerator.default.wrap(function _callee3$(_context3) {
           while (1) {
             switch (_context3.prev = _context3.next) {
               case 0:
                 that = _this;
                 if (!that.id) {
-                  _context3.next = 6;
+                  _context3.next = 8;
                   break;
                 }
-                _context3.next = 4;
-                return that.$api("/ticket/".concat(that.id), 'GET', {});
-              case 4:
+                info = {};
+                if (that.user._id) info.user = that.user._id;
+                _context3.next = 6;
+                return that.$api("/ticket/ticket".concat(that.id), 'GET', info);
+              case 6:
                 res = _context3.sent;
                 if (res.errcode == '0') {
                   type = that.typeList.find(function (i) {
@@ -373,7 +376,7 @@ var _default = {
                     title: res.errmsg
                   });
                 }
-              case 6:
+              case 8:
               case "end":
                 return _context3.stop();
             }
@@ -393,9 +396,46 @@ var _default = {
       }
     },
     // 收藏
-    onClick: function onClick() {
-      var that = this;
-      console.log("收藏");
+    onClick: function onClick(item) {
+      var _this2 = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+        var that, res, form;
+        return _regenerator.default.wrap(function _callee4$(_context4) {
+          while (1) {
+            switch (_context4.prev = _context4.next) {
+              case 0:
+                that = _this2;
+                if (!(item.is_collect == false)) {
+                  _context4.next = 8;
+                  break;
+                }
+                form = {
+                  user: that.user._id,
+                  source: item._id,
+                  source_type: "ticket",
+                  type: '1',
+                  create_time: (0, _moment.default)().format('YYYY-MM-DD HH:mm:ss')
+                };
+                _context4.next = 5;
+                return that.$api("/like", 'POST', form);
+              case 5:
+                res = _context4.sent;
+                _context4.next = 11;
+                break;
+              case 8:
+                _context4.next = 10;
+                return that.$api("/like/".concat(item.like), 'DELETE', {});
+              case 10:
+                res = _context4.sent;
+              case 11:
+                if (res.errcode == '0') that.search();
+              case 12:
+              case "end":
+                return _context4.stop();
+            }
+          }
+        }, _callee4);
+      }))();
     },
     // 预订
     toBuy: function toBuy(item) {
@@ -410,28 +450,28 @@ var _default = {
     },
     // 查询其他信息
     searchOther: function searchOther() {
-      var _this2 = this;
-      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+      var _this3 = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
         var that, res;
-        return _regenerator.default.wrap(function _callee4$(_context4) {
+        return _regenerator.default.wrap(function _callee5$(_context5) {
           while (1) {
-            switch (_context4.prev = _context4.next) {
+            switch (_context5.prev = _context5.next) {
               case 0:
-                that = _this2;
-                _context4.next = 3;
+                that = _this3;
+                _context5.next = 3;
                 return that.$api("/dictData", 'GET', {
                   type: 'project_type',
                   is_use: '0'
                 });
               case 3:
-                res = _context4.sent;
+                res = _context5.sent;
                 if (res.errcode == '0') that.$set(that, "typeList", res.data);
               case 5:
               case "end":
-                return _context4.stop();
+                return _context5.stop();
             }
           }
-        }, _callee4);
+        }, _callee5);
       }))();
     }
   }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 48 - 39
unpackage/dist/dev/mp-weixin/pagesHome/type/index.js


+ 49 - 11
unpackage/dist/dev/mp-weixin/pagesHome/type/info.js

@@ -180,6 +180,7 @@ Object.defineProperty(exports, "__esModule", {
 exports.default = void 0;
 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 30));
 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 32));
+var _moment = _interopRequireDefault(__webpack_require__(/*! moment */ 52));
 //
 //
 //
@@ -337,34 +338,71 @@ var _default = {
       }
     },
     // 收藏
-    onClick: function onClick() {
-      var that = this;
-      console.log("收藏");
-    },
-    // 查询其他信息
-    searchOther: function searchOther() {
+    onClick: function onClick(item) {
       var _this2 = this;
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
-        var that, res;
+        var that, res, form;
         return _regenerator.default.wrap(function _callee3$(_context3) {
           while (1) {
             switch (_context3.prev = _context3.next) {
               case 0:
                 that = _this2;
-                _context3.next = 3;
+                if (!(item.is_collect == false)) {
+                  _context3.next = 8;
+                  break;
+                }
+                form = {
+                  user: that.user._id,
+                  source: item._id,
+                  source_type: "location",
+                  type: '1',
+                  create_time: (0, _moment.default)().format('YYYY-MM-DD HH:mm:ss')
+                };
+                _context3.next = 5;
+                return that.$api("/like", 'POST', form);
+              case 5:
+                res = _context3.sent;
+                _context3.next = 11;
+                break;
+              case 8:
+                _context3.next = 10;
+                return that.$api("/like/".concat(item.like), 'DELETE', {});
+              case 10:
+                res = _context3.sent;
+              case 11:
+                if (res.errcode == '0') that.search();
+              case 12:
+              case "end":
+                return _context3.stop();
+            }
+          }
+        }, _callee3);
+      }))();
+    },
+    // 查询其他信息
+    searchOther: function searchOther() {
+      var _this3 = this;
+      return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+        var that, res;
+        return _regenerator.default.wrap(function _callee4$(_context4) {
+          while (1) {
+            switch (_context4.prev = _context4.next) {
+              case 0:
+                that = _this3;
+                _context4.next = 3;
                 return that.$api("/dictData", 'GET', {
                   type: 'project_type',
                   is_use: '0'
                 });
               case 3:
-                res = _context3.sent;
+                res = _context4.sent;
                 if (res.errcode == '0') that.$set(that, "typeList", res.data);
               case 5:
               case "end":
-                return _context3.stop();
+                return _context4.stop();
             }
           }
-        }, _callee3);
+        }, _callee4);
       }))();
     }
   }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 53 - 40
unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.js


+ 3 - 1
unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.json

@@ -1,5 +1,7 @@
 {
   "navigationBarTitleText": "收藏",
   "enablePullDownRefresh": true,
-  "usingComponents": {}
+  "usingComponents": {
+    "tabs": "/components/tabs/index"
+  }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.wxml


+ 15 - 10
unpackage/dist/dev/mp-weixin/pagesIndex/collect/index.wxss

@@ -13,16 +13,21 @@
   background-color: var(--f9Color);
   margin: 2vw 0 0 0;
 }
-.main .one .pubuBox.data-v-5dd57b4c {
+.main .one .tabsList.data-v-5dd57b4c {
+  position: relative;
+  width: 100vw;
+  height: 90vh;
+}
+.main .one .tabsList .pubuBox.data-v-5dd57b4c {
   padding: 2vw;
 }
-.main .one .pubuItem.data-v-5dd57b4c {
+.main .one .tabsList .pubuItem.data-v-5dd57b4c {
   -webkit-column-count: 2;
           column-count: 2;
   -webkit-column-gap: 2vw;
           column-gap: 2vw;
 }
-.main .one .list.data-v-5dd57b4c {
+.main .one .tabsList .list.data-v-5dd57b4c {
   box-sizing: border-box;
   border-radius: 2vw;
   overflow: hidden;
@@ -33,15 +38,15 @@
   box-sizing: border-box;
   margin-bottom: 2vw;
 }
-.main .one .list image.data-v-5dd57b4c {
+.main .one .tabsList .list image.data-v-5dd57b4c {
   width: 100%;
 }
-.main .one .title.data-v-5dd57b4c {
+.main .one .tabsList .title.data-v-5dd57b4c {
   padding: 2vw;
 }
-.main .one .title .title_1.data-v-5dd57b4c {
+.main .one .tabsList .title .title_1.data-v-5dd57b4c {
   font-size: var(--font14Size);
-  line-height: 4vw;
+  line-height: 4.5vw;
   text-overflow: -o-ellipsis-lastline;
   overflow: hidden;
   text-overflow: ellipsis;
@@ -52,18 +57,18 @@
   min-height: 6vw;
   max-height: 20vw;
 }
-.main .one .title .title_2.data-v-5dd57b4c {
+.main .one .tabsList .title .title_2.data-v-5dd57b4c {
   display: flex;
   justify-content: space-between;
   font-size: var(--font12Size);
   color: var(--f69Color);
   padding: 1vw 0;
 }
-.main .one .title .title_2 .right.data-v-5dd57b4c {
+.main .one .tabsList .title .title_2 .right.data-v-5dd57b4c {
   display: flex;
   align-items: center;
 }
-.main .one .title .title_2 .right text.data-v-5dd57b4c:first-child {
+.main .one .tabsList .title .title_2 .right text.data-v-5dd57b4c:first-child {
   padding: 0 1vw 0 0;
 }
 .scroll-view.data-v-5dd57b4c {