ソースを参照

Merge remote-tracking branch 'origin/master'

chenqilong 1 年間 前
コミット
20783a26dc

+ 83 - 90
package-lock.json

@@ -3054,6 +3054,44 @@
           "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
           "dev": true
         },
+        "ansi-styles": {
+          "version": "4.3.0",
+          "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
+          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-convert": "^2.0.1"
+          }
+        },
+        "chalk": {
+          "version": "4.1.2",
+          "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
+          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-styles": "^4.1.0",
+            "supports-color": "^7.1.0"
+          }
+        },
+        "color-convert": {
+          "version": "2.0.1",
+          "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
+          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "color-name": "~1.1.4"
+          }
+        },
+        "color-name": {
+          "version": "1.1.4",
+          "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
+          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+          "dev": true,
+          "optional": true
+        },
         "css-loader": {
           "version": "3.6.0",
           "resolved": "https://registry.npmmirror.com/css-loader/-/css-loader-3.6.0.tgz",
@@ -3111,6 +3149,13 @@
             "pump": "^3.0.0"
           }
         },
+        "has-flag": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
+          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+          "dev": true,
+          "optional": true
+        },
         "hash-sum": {
           "version": "2.0.0",
           "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-2.0.0.tgz",
@@ -3213,6 +3258,42 @@
           "requires": {
             "minipass": "^3.1.1"
           }
+        },
+        "supports-color": {
+          "version": "7.2.0",
+          "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
+          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "has-flag": "^4.0.0"
+          }
+        },
+        "vue-loader-v16": {
+          "version": "npm:vue-loader@16.8.3",
+          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
+          "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chalk": "^4.1.0",
+            "hash-sum": "^2.0.0",
+            "loader-utils": "^2.0.0"
+          },
+          "dependencies": {
+            "loader-utils": {
+              "version": "2.0.4",
+              "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz",
+              "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
+              "dev": true,
+              "optional": true,
+              "requires": {
+                "big.js": "^5.2.2",
+                "emojis-list": "^3.0.0",
+                "json5": "^2.1.2"
+              }
+            }
+          }
         }
       }
     },
@@ -10435,7 +10516,7 @@
     },
     "js-perform-lock": {
       "version": "1.0.5",
-      "resolved": "http://121.41.110.30:4873/js-perform-lock/-/js-perform-lock-1.0.5.tgz",
+      "resolved": "https://registry.npmmirror.com/js-perform-lock/-/js-perform-lock-1.0.5.tgz",
       "integrity": "sha512-aDp38fxLnur2YMsJhw1Ab23PdwceXMU5Pkcb4R5MSaRfySiDwbDR2L/ysnB4X7/1XERkLC56r32qwtNlitBSGg=="
     },
     "js-tokens": {
@@ -16159,94 +16240,6 @@
         "vue-style-loader": "^4.1.0"
       }
     },
-    "vue-loader-v16": {
-      "version": "npm:vue-loader@16.8.3",
-      "resolved": "http://121.41.110.30:4873/vue-loader/-/vue-loader-16.8.3.tgz",
-      "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
-      "dev": true,
-      "optional": true,
-      "requires": {
-        "chalk": "^4.1.0",
-        "hash-sum": "^2.0.0",
-        "loader-utils": "^2.0.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "4.3.0",
-          "resolved": "http://121.41.110.30:4873/ansi-styles/-/ansi-styles-4.3.0.tgz",
-          "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-convert": "^2.0.1"
-          }
-        },
-        "chalk": {
-          "version": "4.1.2",
-          "resolved": "http://121.41.110.30:4873/chalk/-/chalk-4.1.2.tgz",
-          "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "ansi-styles": "^4.1.0",
-            "supports-color": "^7.1.0"
-          }
-        },
-        "color-convert": {
-          "version": "2.0.1",
-          "resolved": "http://121.41.110.30:4873/color-convert/-/color-convert-2.0.1.tgz",
-          "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "color-name": "~1.1.4"
-          }
-        },
-        "color-name": {
-          "version": "1.1.4",
-          "resolved": "http://121.41.110.30:4873/color-name/-/color-name-1.1.4.tgz",
-          "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-          "dev": true,
-          "optional": true
-        },
-        "has-flag": {
-          "version": "4.0.0",
-          "resolved": "http://121.41.110.30:4873/has-flag/-/has-flag-4.0.0.tgz",
-          "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
-          "dev": true,
-          "optional": true
-        },
-        "hash-sum": {
-          "version": "2.0.0",
-          "resolved": "http://121.41.110.30:4873/hash-sum/-/hash-sum-2.0.0.tgz",
-          "integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg==",
-          "dev": true,
-          "optional": true
-        },
-        "loader-utils": {
-          "version": "2.0.4",
-          "resolved": "http://121.41.110.30:4873/loader-utils/-/loader-utils-2.0.4.tgz",
-          "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "big.js": "^5.2.2",
-            "emojis-list": "^3.0.0",
-            "json5": "^2.1.2"
-          }
-        },
-        "supports-color": {
-          "version": "7.2.0",
-          "resolved": "http://121.41.110.30:4873/supports-color/-/supports-color-7.2.0.tgz",
-          "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
-          "dev": true,
-          "optional": true,
-          "requires": {
-            "has-flag": "^4.0.0"
-          }
-        }
-      }
-    },
     "vue-pdf": {
       "version": "4.3.0",
       "resolved": "https://registry.npmmirror.com/vue-pdf/-/vue-pdf-4.3.0.tgz",
@@ -16951,7 +16944,7 @@
     },
     "weixin-js-sdk": {
       "version": "1.6.3",
-      "resolved": "http://121.41.110.30:4873/weixin-js-sdk/-/weixin-js-sdk-1.6.3.tgz",
+      "resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.3.tgz",
       "integrity": "sha512-5jYNtVcxWmgHNqCLSPoX6vXab9G4RPDZx0klX8IsVwGjDTwx/UDmgfF7fkRMGguRpuFv0O7tk1jb+Oay2QiV1w=="
     },
     "whatwg-encoding": {

+ 26 - 27
src/common/http/index.js

@@ -3,6 +3,11 @@ import {
   platform
 } from '../utils/index';
 import store from '@/store/index.js'
+
+import {
+  goLoginPage
+} from "@/mixins/index.js"
+
 const program = {
   H5: "wap",
   APP: "app",
@@ -11,10 +16,10 @@ const program = {
 };
 const whiteCodes = [200, 201, 4444]
 
-export const $http = (url, method, data, json) => {
+export const $http = (url, method, data, json, loadingBool = true) => {
   //设置请求前拦截器
   http.interceptor.request = (config) => {
-    if (url !== '/homepage/study') {
+    if (loadingBool && url !== '/homepage/study') {
       uni.showLoading({
         title: '加载中...'
       })
@@ -30,28 +35,22 @@ export const $http = (url, method, data, json) => {
   //设置请求结束后拦截器
   http.interceptor.response = async (response) => {
     //判断返回状态 执行相应操作
-    uni.hideLoading()
+    if (loadingBool) {
+      uni.hideLoading()
+    }
     const res = response.data;
     if (whiteCodes.indexOf(res.code) < 0) {
+      if (res.code === 1001) {
+        goLoginPage()
+        return {}
+      }
+
       uni.showToast({
         title: res.message || 'Error',
         icon: 'none',
         duration: 1500
       })
 
-      if (res.code === 1001 || res.code === 7777 || res.code === 8888) {
-
-        // return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
-        // store.dispatch('user/resetToken').then(() => {
-        //   uni.navigateTo({
-        //     url: '/pages/login/indexs'
-        //   })
-        // })
-
-        // uni.navigateTo({
-        //   url: '/pages/login/indexs'
-        // })
-      }
       return Promise.reject(new Error(res.message || 'Error'))
     } else {
       return res
@@ -103,24 +102,24 @@ async function doRequest(response, url) {
   }
 }
 
-function postJson(url, data) {
-  return $http(url, 'POST', data)
+function postJson(url, data, loadingBool) {
+  return $http(url, 'POST', data, false, loadingBool)
 }
 
-function get(url, data) {
-  return $http(url, 'GET', data)
+function get(url, data, loadingBool) {
+  return $http(url, 'GET', data, false, loadingBool)
 }
 
-function post(url, data) {
-  return $http(url, 'POST', data, true)
+function post(url, data, loadingBool) {
+  return $http(url, 'POST', data, true, loadingBool)
 }
 
-function put(url, data) {
-  return $http(url, 'PUT', data, true)
+function put(url, data, loadingBool) {
+  return $http(url, 'PUT', data, true, loadingBool)
 }
 
-function del(url, data) {
-  return $http(url, 'DELETE', data, true)
+function del(url, data, loadingBool) {
+  return $http(url, 'DELETE', data, true, loadingBool)
 }
 
 export default {
@@ -129,4 +128,4 @@ export default {
   post,
   put,
   del
-}
+}

+ 79 - 2
src/common/utils/common.js

@@ -205,6 +205,82 @@ export const copy = (val) => {
       successToast('复制成功');
     },
   });
+};
+
+// 获取当前定位
+export const getLocation = async function() {
+	return new Promise((resolve, reject) => {
+		uni.getLocation({
+			type: 'gcj02',
+			geocode: true,
+			success: (res) => {
+				resolve(res);
+			},
+			fail: (err) => {
+				console.log('获取当前定位失败', err);
+				uni.authorize({
+					scope: 'scope.userLocation',
+					success: () => {
+						// 允许授权
+						uni.getLocation({
+							type: 'gcj02',
+							geocode: true,
+							success: (res) => {
+								resolve(res);
+							},
+							fail: (err) => {
+								modal({
+									title: '提示',
+									content: '定位失败,请重试',
+									showCancel: false,
+								}).then(() => {});
+							},
+						});
+					},
+					fail: () => {
+						// 拒绝授权
+						modal({
+							title: '提示',
+							content: '定位失败,请重试',
+							showCancel: false,
+							// confirmText: '重新定位',
+						}).then(() => {
+							// getLocation();
+						});
+					},
+				});
+			},
+		});
+	});
+};
+
+// 获取地址
+export const getAddress = async function() {
+	const location = await getLocation();
+	return new Promise((resolve, reject) => {
+		uni.request({
+			url: 'https://restapi.amap.com/v3/geocode/regeo',
+			method: 'GET',
+			data: {
+				location: location.longitude + ',' + location.latitude,
+				key: 'b772f8b0ace6bc96c04ae8e48f241e36',
+			},
+			success: (res) => {
+				resolve({
+					longitude: location.longitude,
+					latitude: location.latitude,
+					address: res.data.regeocode.formatted_address,
+					province: res.data.regeocode.addressComponent.province,
+					city: res.data.regeocode.addressComponent.city,
+					area: res.data.regeocode.addressComponent.district,
+					street: res.data.regeocode.addressComponent.township,
+				});
+			},
+			fail: function(err) {
+				console.log('地址解析失败' + err);
+			},
+		});
+	});
 };
 
 // 判断微信环境
@@ -239,7 +315,6 @@ export function getQueryVariable(variable) {
   return undefined;
 }
 
-
 export default {
   toast,
   successToast,
@@ -251,5 +326,7 @@ export default {
   redPage,
   backPage,
   callPhone,
-  copy
+  copy,
+	getLocation,
+	getAddress,
 };

+ 18 - 4
src/common/utils/navPag.js

@@ -15,7 +15,7 @@ export const navToPage = (function() {
     // #ifdef H5
     if (isWeixin()) {
       wx.miniProgram.getEnv(res => {
-        if (res.miniprogram) {
+        if (res.miniprogram && uni.getStorageSync('miniProgram') == "jsm_env") {
           var i = 0;
           (function goTo() {
             if (gopageid) {
@@ -61,12 +61,26 @@ export const navToPage = (function() {
   }
 })()
 
-export function webViewHref(url) {
+export function webViewHref(url, pam = {}) {
+  var pamstr = Object.entries(pam).map(item => {
+    return item.join("=")
+  }).join("&");
+  // #ifdef H5
   if (!!~url.indexOf("?")) {
     return process.env.VUE_APP_HREF + url +
-      `&x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}`
+      `${pamstr?"&"+pamstr:""}&x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&userId=${store.state.user.userId}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}`
   } else {
     return process.env.VUE_APP_HREF + url +
-      `?x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}`
+      `?${pamstr?pamstr+"&":""}x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&userId=${store.state.user.userId}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}`
   }
+  // #endif
+  // #ifndef H5
+  if (!!~url.indexOf("?")) {
+    return process.env.VUE_APP_HREF + url +
+      `${pamstr?"&"+pamstr:""}&x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&userId=${store.state.user.userId}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}&miniProgram=jsm_env`
+  } else {
+    return process.env.VUE_APP_HREF + url +
+      `?${pamstr?pamstr+"&":""}x-token=${store.state.user.token||''}&openId=${store.state.user.openId||''}&userId=${store.state.user.userId}&username=${store.state.user.name||''}&useravatar=${store.state.user.avatar||''}&miniProgram=jsm_env`
+  }
+  // #endif
 }

+ 3 - 5
src/common/utils/util.js

@@ -4,9 +4,7 @@ import store from '@/store/index.js'
 // 获取用户信息
 export const getUserInfo = () => {
   return new Promise((resolve, reject) => {
-    api.post('/account/getaccountinfo', {
-        accountCode: store.getters.usercode
-      }).then((response) => {
+    api.get('/wechat/user/info').then((response) => {
         const {
           data
         } = response;
@@ -109,7 +107,7 @@ export const getArea = function(str) {
 	} else {
 	  area.Province = str.substring(0, index1 + 1)
 	}
-				 
+
 	let index2 = str.indexOf("市")
 	if (index11 == -1) {
 	  area.City = str.substring(index11 + 1, index2 + 1)
@@ -120,7 +118,7 @@ export const getArea = function(str) {
 	    area.City = str.substring(index11 + 3, index2 + 1)
 	  }
 	}
-				 
+
 	let index3 = str.lastIndexOf("区")
 	if (index3 == -1) {
 	  index3 = str.indexOf("县")

+ 28 - 32
src/components/zj-dialog/zj-dialog-deliver.vue

@@ -19,7 +19,7 @@
         </view>
         <view class="row" v-show="type === 2">
           <view class="label">物流公司</view>
-          <view class="value" @tap="isShowCompanyDialog = true">{{company ? company : '请选择'}}</view>
+          <view class="value" @tap="isShowCompanyDialog = true">{{company ? company.name : '请选择'}}</view>
         </view>
         <view class="row" v-show="type === 2">
           <view class="label">物流单号</view>
@@ -39,8 +39,7 @@
     	:styleType="2"
     	:title="'物流公司'"
     	:list="companyList"
-    	:keyName="'label'"
-    	:isSearch="true"
+    	:keyName="'name'"
     	@search="searchCompanyDialog"
     	@cancel="isShowCompanyDialog = false"
     	@confirm="confirmCompanyDialog">
@@ -62,29 +61,30 @@
 				type: Boolean,
 				default: false
 			},
-			orderId: {
-				type: String,
-				default: ''
-			},
 		},
 
 		data() {
 			return {
+        goodsId: null,
         type: 1, // 发货方式
-        company: '', // 物流公司
+        company: null, // 物流公司
         orderNo: '', // 物流单号
 
-        companyList: [
-          {label: '顺丰快递', value: 1},
-          {label: '申通快递', value: 1},
-        ],
+        companyList: [],
         isShowCompanyDialog: false,
 			}
 		},
 
 		methods: {
       setValue(id) {
+        this.goodsId = id;
+        this.getCompanyList();
+      },
 
+      getCompanyList() {
+        this.$api.post('/orderPay/expressCompany').then(res => {
+          this.companyList = res.data || [];
+        })
       },
 
       searchCompanyDialog() {
@@ -92,7 +92,7 @@
       },
 
       confirmCompanyDialog(e) {
-        this.company = this.companyList[e[0]].label;
+        this.company = this.companyList[e[0]];
         this.isShowCompanyDialog = false;
       },
 
@@ -103,26 +103,22 @@
 			confirmDialog() {
         if(this.type === 2 && !this.company) return this.$toast('请选择物流公司');
         if(this.type === 2 && !this.orderNo) return this.$toast('请填写物流单号');
-
-				let url = '';
-				if(this.detail.dispatchStatus == 'SQGP') {
-					url = '/order/dispatch/ack';
-				}else {
-					url = '/order/rece/ack';
-				}
-				this.$axios({
-					url,
-					method: 'POST',
-					params: {
-						id: this.orderId,
-					},
-					isLoading: 1
-				}).then(res => {
-					uni.$emit('refreshHome');
-					uni.$emit('refreshOrderDetail');
-					this.$successToast('接收成功');
+        
+        let params = {};
+        if(this.type === 2) {
+          params.logisticsName = this.company.name;
+          params.logisticsCode = this.company.code;
+          params.logisticsNum = this.orderNoe;
+        }
+
+				this.$api.post('/orderPay/logisticsAdd', {
+          goodsId: this.goodsId,
+          logisticsType: this.type === 1 ? 'SELF' : 'DELIVERY',
+          ...params
+        }).then(res => {
+					uni.$emit('refreshMyIssueList');
+					this.$successToast('发货成功');
 					this.cancelDialog();
-					this.$navPage(`/packageOrder/pages/orderDetail?id=${this.orderId}`);
 				})
 			}
 		}

+ 2 - 2
src/filters/index.js

@@ -53,8 +53,8 @@ export function dateToHHmmss(date) {
 }
 
 export function priceFilter2(val) {
-	if(!val && val != 0) return '-';
-  if(val == 0) return '面议';
+  if(val === 0) return '面议';
+	if(!val) return '-';
 	val = Number(val);
 	return val.toFixed(2);
 }

+ 5 - 1
src/main.js

@@ -23,6 +23,8 @@ import {
   backPage,
   callPhone,
   copy,
+  getLocation,
+  getAddress,
 } from "common/utils/common"
 import {
   navToPage
@@ -40,6 +42,8 @@ Vue.prototype.$redPage = redPage;
 Vue.prototype.$backPage = backPage;
 Vue.prototype.$callPhone = callPhone;
 Vue.prototype.$copy = copy;
+Vue.prototype.$getLocation = getLocation;
+Vue.prototype.$getAddress = getAddress;
 
 // 注入全局
 import pages from 'mixins';
@@ -80,7 +84,7 @@ Vue.component('my-link', Mylink)
 // #endif
 
 // 渲染图片文件
-Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/file/img/get?key=';
+Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_URL + process.env.VUE_APP_BASE_API + '/img/get?key=';
 
 const app = new Vue({
   ...App,

+ 4 - 4
src/mixins/index.js

@@ -14,14 +14,14 @@ import store from '@/store/index.js'
 import wx from 'weixin-js-sdk'
 // #endif
 
-// #ifdef MP-WEIXIN
 // 微信小程序页面劫持
-var goLoginPage = (new firstPerform(1000)).refactor(function() {
+export const goLoginPage = (new firstPerform(1000)).refactor(function() {
   navToPage({
     url: "/pages/login/indexs"
   }, "redirectTo")
 });
-var routerBeforeEach = (new firstPerform(200)).refactor(function() {
+// #ifdef MP-WEIXIN
+export const routerBeforeEach = (new firstPerform(200)).refactor(function() {
   function getrouter() {
     let routes = getCurrentPages();
     if (routes.length) {
@@ -42,7 +42,7 @@ var routerBeforeEach = (new firstPerform(200)).refactor(function() {
 });
 // #endif
 
-var updatePageLay = (new firstPerform(1000)).refactor(function() {
+const updatePageLay = (new firstPerform(1000)).refactor(function() {
   // 去除顶部
   var uni_page_head = document.querySelector("uni-page-head[uni-page-head-type='default']")
   if (uni_page_head) {

+ 0 - 6
src/pages.json

@@ -109,12 +109,6 @@
       }
     },
     {
-      "path": "pages/mine/myIssue/detail",
-      "style": {
-        "navigationBarTitleText": "订单详情"
-      }
-    },
-    {
       "path": "pages/goods/list",
       "style": {
         "navigationBarTitleText": "商品列表"

+ 114 - 42
src/pages/goods/list.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- #ifdef H5 -->
   <zj-page-layout
   	:hasFooter="false"
   	:isScroll="true"
@@ -9,19 +10,24 @@
       <view class="header-container">
         <u-tabs
           :list="categoryList"
-          @click="click"
-          :scrollable="false"
+          :current="categoryCurrent"
+          @click="clickCategory"
+          keyName="categoryName"
+          :scrollable="categoryList.length === 4 ? false : true"
           lineColor="#01C30B">
         </u-tabs>
         <u-search
           placeholder="输入商品名称搜索"
           :showAction="false"
           clearabled
-          v-model="keyword">
+          v-model="keyword"
+          @search="refreshList"
+          @clear="refreshList">
         </u-search>
         <u-tabs
           :list="tabList"
-          @click="click"
+          :current="tabCurrent"
+          @click="clickTab"
           :scrollable="false"
           lineColor="#01C30B">
         </u-tabs>
@@ -29,24 +35,22 @@
     </template>
 
     <view class="common-goods-list">
-      <view class="item" @tap="$navPage(`/pages/goods/detail`)">
+      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toGoodsDetail(item.id)">
         <view class="top">
           <image src="@/static/common/logo.png"></image>
           <view class="user">
-            <view class="name">张三</view>
-            <view class="time">23小时前发布</view>
+            <view class="name">{{item.userName}}</view>
+            <view class="time">{{item.createTime}}</view>
           </view>
-          <view class="price">¥1888.00</view>
+          <view class="price">{{item.amount | priceFilter2}}</view>
         </view>
-        <view class="title">商品名称</view>
-        <view class="des">商品描述</view>
+        <view class="title">{{item.title}}</view>
+        <view class="des">{{item.content}}</view>
         <view class="imgs">
-          <image src="@/static/user/other_speech.png"></image>
-          <image src="@/static/user/other_speech.png"></image>
-          <image src="@/static/user/other_speech.png"></image>
+          <image :src="imgUrl + it.imgUrl" v-for="(it, idx) in item.goodsFiles" :key="idx"></image>
         </view>
         <view class="bottom">
-          <view class="left-location">天河区棠下</view>
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
           <view class="right-stats">
             <view class="it">
               <text class="iconfont icon-dianzan"></text>
@@ -64,75 +68,143 @@
         </view>
       </view>
     </view>
+
+    <Loading :loadStatus="loadStatus" :dataList="dataList" />
   </zj-page-layout>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/goods/list')"></web-view>
+  <!-- #endif -->
 </template>
 
 <script>
+  // #ifdef H5
   export default {
     data() {
       return {
         imgUrl: this.$imageUrl,
-        categoryList: [
-          {name: '家用空调', value: 1},
-          {name: '商用空调', value: 2},
-          {name: '冷冻空调', value: 3},
-          {name: '特种空调', value: 4},
-        ],
+        categoryList: [],
+        categoryId: '',
         tabList: [
-          {name: '默认顺序', value: 1},
-          {name: '在售商品', value: 2},
-          {name: '离我最近', value: 3},
-          {name: '人气最高', value: 4},
+          {name: '默认顺序', value: 0},
+          {name: '在售商品', value: 1},
+          {name: '离我最近', value: 2},
+          {name: '人气最高', value: 3},
         ],
+        tabCurrent: 0,
         keyword: '',
         dataList: [],
         pageNum: 1,
+        loadStatus: 0,
         refresherTriggered: false,
       }
     },
 
-    async onLoad() {
-      // await this.getList()
+    computed:{
+    	categoryCurrent() {
+        if(this.categoryId) {
+          return this.categoryList.map(item => item.categoryId).indexOf(this.categoryId)
+        }else {
+          return 0
+        }
+    	}
+    },
+
+    async onLoad({categoryId, keyword}) {
+      console.log(categoryId);
+      console.log(keyword);
+      this.categoryId = categoryId;
+      this.keyword = keyword;
+      await this.getCategory();
+      await this.getList();
     },
 
     methods: {
+      async getCategory() {
+        return new Promise((resolve, reject) => {
+          this.$api.get('/goods/category/list')
+          .then(res => {
+            this.categoryList = res.data || [];
+          }).finally(res => {
+            resolve(1);
+          })
+        })
+      },
+
       //获取列表数据
       async getList() {
-        this.$api.post('/xxx/xxxlist', {
+        let params = {};
+        if(this.tabCurrent === 1) {
+          params.status = '1';
+        }else if(this.tabCurrent === 2) {
+          params.lng = this.lng;
+          params.lat = this.lat;
+        }else if(this.tabCurrent === 3) {
+          params.visitOrderBy = 'YES';
+        }
+
+        this.$api.get('/goods/list', {
           pageNum: this.pageNum,
           pageSize: 10,
+          categoryId: this.categoryId,
+          title: this.keyword,
+          ...params
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
-          if(list.length < 10){
-          	this.loadStatus = 2;
+          if (list.length < 10) {
+            this.loadStatus = 2;
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+          this.loadStatus = 2;
+        })
+      },
+
+      clickCategory(item) {
+        this.categoryId = item.categoryId;
+        this.refreshList();
+      },
+
+      clickTab(item) {
+        this.tabCurrent = item.value;
+        this.refreshList();
       },
 
       // 滚动到底部
       scrolltolower(e) {
-      	if (this.loadStatus === 0) {
-      		this.pageNum++;
-      		this.getList();
-      	}
+        if (this.loadStatus === 0) {
+          this.pageNum++;
+          this.getList();
+        }
       },
 
       // 触发下拉刷新
-      refresherrefresh(e) {
-      	this.refresherTriggered = true;
-      	this.dataList = [];
-      	this.pageNum = 1;
-      	this.getList();
+      async refresherrefresh(e) {
+        this.refresherTriggered = true;
+        // await this.getCategory();
+        this.refreshList();
+        this.refresherTriggered = false;
+      },
+
+      refreshList() {
+        this.dataList = [];
+        this.pageNum = 1;
+        this.getList();
+      },
+
+      toGoodsDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?${id}`
+        })
       },
 
     }
   }
+  // #endif
+  // #ifndef H5
+
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 86 - 16
src/pages/index/index.vue

@@ -10,7 +10,7 @@
 
       <view class="all-container">
         <view class="search-container">
-          <u-search placeholder="输入商品名称搜索" :showAction="false" clearabled v-model="keyword">
+          <u-search placeholder="输入商品名称搜索" :showAction="false" clearabled v-model="keyword" @search="handleSearch">
           </u-search>
         </view>
 
@@ -19,19 +19,19 @@
         </view>
 
         <view class="category-container card mt30">
-          <view class="item" v-for="(item, index) in categoryList" :key="index" @tap="$navPage(`/pages/goods/list?${item.categoryId}`)">
+          <view class="item" v-for="(item, index) in categoryList" :key="index" @tap="toGoodsList(item.categoryId)">
             <image :src="imageUrl + item.imgUrl"></image>
             <view class="name">{{item.categoryName}}</view>
           </view>
         </view>
 
         <view class="tab-container mt30">
-          <u-tabs :list="tabList" @click="click" :scrollable="false" lineColor="#01C30B">
+          <u-tabs :list="tabList" @click="clickTab" :current="tabCurrent" :scrollable="false" lineColor="#01C30B">
           </u-tabs>
         </view>
 
         <view class="common-goods-list">
-          <view class="item card" v-for="(item, index) in dataList" :key="index" @tap="$navPage(`/pages/goods/detail`)">
+          <view class="item card" v-for="(item, index) in dataList" :key="index" @tap="toGoodsDetail(item.id)">
             <view class="top">
               <image src="@/static/common/logo.png"></image>
               <view class="user">
@@ -64,7 +64,7 @@
             </view>
           </view>
         </view>
-        
+
         <Loading :loadStatus="loadStatus" :dataList="dataList" />
 
       </view>
@@ -87,29 +87,29 @@
         loadStatus: 0,
         refresherTriggered: false,
         keyword: '',
-        bannerList: [
-          'https://cdn.uviewui.com/uview/swiper/swiper3.png',
-          'https://cdn.uviewui.com/uview/swiper/swiper2.png',
-          'https://cdn.uviewui.com/uview/swiper/swiper1.png',
-        ],
+        bannerList: [],
         categoryList: [],
         tabList: [{
             name: '默认顺序',
-            value: 1
+            value: 0
           },
           {
             name: '在售商品',
-            value: 2
+            value: 1
           },
           {
             name: '离我最近',
-            value: 3
+            value: 2
           },
           {
             name: '人气最高',
-            value: 4
+            value: 3
           },
         ],
+        tabCurrent: 0,
+
+        lat: '',
+        lng: '',
       }
     },
 
@@ -120,11 +120,41 @@
     },
 
     async onLoad() {
+      await this.getBanner();
       await this.getCategory();
       await this.getList();
+      let lo = await this.$getLocation();
+      this.lat = lo.latitude;
+      this.lng = lo.longitude;
     },
 
     methods: {
+      async getBanner() {
+        // let res = await this.$api.get('/carouselMap/list/page', {
+        //   pageNum: 1,
+        //   pageSize: -1,
+        //   state: true
+        // })
+        // this.bannerList = res.data.records;
+        // return res.data.records
+
+        return new Promise((resolve, reject) => {
+          this.$api.get('/carouselMap/list/page', {
+            pageNum: 1,
+            pageSize: -1,
+            state: true
+          }).then(res => {
+            if(res.data && res.data.records) {
+              this.bannerList = res.data.records.map(item => {
+                return this.imageUrl + item.imgSrc;
+              });
+            }
+          }).finally(res => {
+            resolve(1);
+          })
+        })
+      },
+
       async getCategory() {
         return new Promise((resolve, reject) => {
           this.$api.get('/goods/category/list')
@@ -138,9 +168,20 @@
 
       //获取列表数据
       async getList() {
+        let params = {};
+        if(this.tabCurrent === 1) {
+          params.status = '1';
+        }else if(this.tabCurrent === 2) {
+          params.lng = this.lng;
+          params.lat = this.lat;
+        }else if(this.tabCurrent === 3) {
+          params.visitOrderBy = 'YES';
+        }
+
         this.$api.get('/goods/list', {
           pageNum: this.pageNum,
           pageSize: 10,
+          ...params
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
@@ -153,6 +194,11 @@
         })
       },
 
+      clickTab(item) {
+        this.tabCurrent = item.value;
+        this.refreshList();
+      },
+
       // 滚动到底部
       scrolltolower(e) {
         if (this.loadStatus === 0) {
@@ -164,11 +210,35 @@
       // 触发下拉刷新
       async refresherrefresh(e) {
         this.refresherTriggered = true;
+        await this.getBanner();
+        await this.getCategory();
+        this.refreshList();
+        this.refresherTriggered = false;
+      },
+
+      refreshList() {
         this.dataList = [];
         this.pageNum = 1;
         this.getList();
-        await this.getCategory();
-        this.refresherTriggered = false;
+      },
+      
+      handleSearch() {
+        this.$navToPage({
+          url: `/pages/goods/list?keyword=${this.keyword}`
+        })
+        this.keyword = '';
+      },
+
+      toGoodsList(categoryId) {
+        this.$navToPage({
+          url: `/pages/goods/list?categoryId=${categoryId}`
+        })
+      },
+
+      toGoodsDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?id=${id}`
+        })
       },
 
     }

+ 2 - 1
src/pages/login/indexs.vue

@@ -111,6 +111,7 @@
               this.$store.commit("user/set_openId", res.data.openId)
               this.$store.commit("user/set_name", res.data.name)
               this.$store.commit("user/set_avatar", res.data.avatar)
+              this.$store.commit("user/set_userId", res.data.baseUserId)
               this.$navToPage({
                 url: "/pages/index/index"
               }, "switchTab")
@@ -217,4 +218,4 @@
     background: linear-gradient(135deg, #7fdaff 0%, #6da7ff 100%);
     border-radius: 50rpx;
   }
-</style>
+</style>

+ 39 - 10
src/pages/message/index.vue

@@ -2,7 +2,7 @@
   <!-- #ifdef H5 -->
   <view class="message_view_page">
     <!-- 横幅 -->
-    <view class="gonggao">
+    <view class="gonggao" @click="goFpzn">
       <view>防骗手册,为您保驾护航</view>
       <text class="iconfont icon-jinru"></text>
     </view>
@@ -10,28 +10,29 @@
     <view class="message_view">
       <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" :enhanced="true"
         :bounces="false" :show-scrollbar="false" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
-        <view class="message_user_aview" v-for="(item,index) in 15" :key="index" @click="goMsgView">
+        <view class="message_user_aview" v-for="(item,index) in list" :key="index" @click="goMsgView(item)">
           <view class="message_user_a">
             <view class="message_user_info">
               <!-- 头像 -->
               <view class="user_head">
-
+                <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.userPic"></image>
               </view>
               <view class="user_info">
                 <!-- 姓名 -->
-                <view class="user_name">{{item}}张锋</view>
+                <view class="user_name">{{item.userName}}</view>
                 <!-- 聊天信息最后一条 -->
-                <view class="user_goods">商品很nice</view>
+                <view class="user_goods">{{item.message}}</view>
                 <!-- 聊天信息最后一条的时间 -->
-                <view class="user_time">2023-10-21 12:20:21</view>
+                <view class="user_time">{{item.createTime}}</view>
               </view>
               <!-- 商品图片 -->
               <view class="goods_img">
-
+                <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.goods_img"></image>
               </view>
             </view>
           </view>
         </view>
+        <Loading v-if="!list.length" :loadStatus="2" :dataList="list" />
       </scroll-view>
     </view>
   </view>
@@ -42,11 +43,34 @@
 </template>
 
 <script>
+  import api from '@/common/http/'
   export default {
     // #ifdef H5
     data() {
       return {
         scrollTop: 0,
+        list: []
+      }
+    },
+    onShow() {
+      var getList = () => {
+        if (this.timeId) {
+          clearTimeout(this.timeId)
+        }
+        api.postJson('/user/talk/list2', {
+          userId: this.$store.state.user.userId,
+          pageNum: 1,
+          pageSize: -1
+        }, false).then(res => {
+          this.list = res.data.records
+          this.timeId = setTimeout(getList, 3000)
+        })
+      }
+      getList()
+    },
+    onHide() {
+      if (this.timeId) {
+        clearTimeout(this.timeId)
       }
     },
     methods: {
@@ -59,11 +83,16 @@
       scroll(e) {
         this.scrollTop = e.detail.scrollTop
       },
-      goMsgView() {
+      goMsgView(item) {
         this.$navToPage({
-          url: '/pages/message/msgView'
+          url: '/pages/message/msgView?goodsId=' + item.goodsId || '' + "&groupId=" + item.groupId || ''
         })
-      }
+      },
+      goFpzn(item) {
+        this.$navToPage({
+          url: '/pages/mine/parse?type=1'
+        })
+      },
     },
     // #endif
     // #ifndef H5

+ 171 - 23
src/pages/message/msgView.vue

@@ -2,20 +2,22 @@
   <!-- #ifdef H5 -->
   <view class="message_view_page">
     <!-- 横幅 -->
-    <view class="gonggao">
+    <view class="gonggao" @click="goFpzn">
       <view>防骗手册,为您保驾护航</view>
       <text class="iconfont icon-jinru"></text>
     </view>
     <!-- 商品信息 -->
     <view class="goods_info">
       <!-- 商品图片 -->
-      <view class="goods_img"></view>
+      <view class="goods_img">
+        <image style="width: 100%; height: 100%;" mode="aspectFill" :src="goodsDetail.goodsPicUrl"></image>
+      </view>
       <!-- 商品描述 -->
       <view class="goods_text">
-        <view class="goods_name">商品的名称展示</view>
+        <view class="goods_name">{{goodsDetail.title}}</view>
         <view class="goods_pon">
           <view>
-            <view class="goods_jiag">¥{{180.00}}</view>
+            <view class="goods_jiag">{{goodsDetail.amount?"¥"+goodsDetail.amount:"面议"}}</view>
             <view class="goods_fuwu">卖家包运费</view>
           </view>
           <view class="go_goods_btn">立即购买</view>
@@ -26,31 +28,33 @@
     <view class="message_view">
       <scroll-view class="message_view_scroll" :scroll-y="true" :scroll-top="scrollTop" :enhanced="true"
         :bounces="false" :show-scrollbar="false" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll">
-        <view style="box-sizing: border-box;padding: 10rpx 0;">
-          <view v-for="(item,index) in 50" :key="index">
+        <view style="box-sizing: border-box;padding: 10rpx 0;" ref="scrollviewDiv" class="scrollviewDiv">
+          <view v-for="(item,index) in list" :key="index">
             <!-- 右消息 -->
-            <view class="msg_view">
+            <view class="msg_view" v-if="userId===item.userId">
               <!-- 占位 -->
               <view class="msg_user_img_kong">
               </view>
               <view class="msg_view_info msg_view_info_right">
                 <view class="msg_view_conent">
-                  12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl12465479198kuhsadbckaehbl
+                  {{item.message}}
                 </view>
-                <view class="msg_view_time">2023-10-11 12:12:12</view>
+                <view class="msg_view_time">{{item.createTime}}</view>
               </view>
               <!-- 头像 -->
               <view class="msg_user_img">
+                <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.userPic"></image>
               </view>
             </view>
             <!-- 左消息 -->
-            <view class="msg_view">
+            <view class="msg_view" v-else>
               <!-- 头像 -->
               <view class="msg_user_img">
+                <image style="width: 100%; height: 100%;" mode="aspectFill" :src="item.userPic"></image>
               </view>
               <view class="msg_view_info msg_view_info_left">
-                <view class="msg_view_conent">12465479198kuhsadbckaehbl</view>
-                <view class="msg_view_time">2023-10-11 12:12:12</view>
+                <view class="msg_view_conent">{{item.message}}</view>
+                <view class="msg_view_time">{{item.createTime}}</view>
               </view>
               <!-- 占位 -->
               <view class="msg_user_img_kong">
@@ -65,10 +69,15 @@
       <view class="text_input_view">
         <view class="text_input_lay">
           <view class="text_input_tengh">
-            <input class="uni-input_chat" focus placeholder="请输入" />
+            <input class="uni-input_chat" focus placeholder="请输入" v-model="message" />
           </view>
-          <view class="text_input_mount" @click="gengduo = !gengduo">
+          <!-- 更多功能 -->
+          <!-- <view class="text_input_mount" @click="gengduo = !gengduo">
             +
+          </view> -->
+          <!-- 发送消息 -->
+          <view class="text_input_mount" @click="send">
+            <image style="width: 50%; height: 53%;" mode="aspectFill" src="/static/tabBar/icon_issue01.png"></image>
           </view>
         </view>
       </view>
@@ -94,34 +103,173 @@
   </view>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/message/msgView')"></web-view>
+  <web-view :src="webViewHref('/pages/message/msgView',pam)"></web-view>
   <!-- #endif -->
 </template>
 
 <script>
+  import api from '@/common/http/'
   export default {
-    // #ifdef H5
     data() {
       return {
         scrollTop: 0,
-        gengduo: false
+        gengduo: false,
+        pam: {},
+        list: [],
+        message: "",
+        userId: this.$store.state.user.userId,
+        goodsDetail: {}
+      }
+    },
+    onLoad(pam) {
+      this.pam = pam
+    },
+    onShow() {
+      // #ifdef H5
+      this.getGoods()
+      this.getMsgList(2, () => {
+        this.getNewList()
+        this.$nextTick(() => {
+          uni.createSelectorQuery().select('.message_view_scroll').boundingClientRect(data => {
+            uni.createSelectorQuery().select('.scrollviewDiv').boundingClientRect(data2 => {
+              this.scrollTop = data2.height - data.height
+            }).exec()
+          }).exec()
+        })
+      })
+      // #endif
+    },
+    onHide() {
+      // #ifdef H5
+      if (this.timeId) {
+        clearTimeout(this.timeId)
       }
+      // #endif
+    },
+    destroyed() {
+      // #ifdef H5
+      if (this.timeId) {
+        clearTimeout(this.timeId)
+      }
+      // #endif
     },
     methods: {
+      // #ifdef H5
+      getGoods() {
+        if (!this.pam.goodsId) {
+          return
+        }
+        api.postJson('/goods/detail', {
+          id: this.pam.goodsId,
+        }, false).then(res => {
+          this.goodsDetail = res.data
+        })
+      },
+      getNewList() {
+        if (this.timeId) {
+          clearTimeout(this.timeId)
+        }
+        uni.createSelectorQuery().select('.scrollviewDiv').boundingClientRect(data1 => {
+          this.getMsgList(0, () => {
+            this.timeId = setTimeout(this.getNewList, 3000)
+            this.$nextTick(() => {
+              uni.createSelectorQuery().select('.message_view_scroll').boundingClientRect(data => {
+                uni.createSelectorQuery().select('.scrollviewDiv').boundingClientRect(data2 => {
+                  if (data1.height - data.height - this.scrollTop < 10) {
+                    this.scrollTop = data2.height - data.height
+                  }
+                }).exec()
+              }).exec()
+            })
+          })
+        }).exec()
+      },
+      getMsgList(flag, cb) {
+        api.postJson('/user/talk/list', {
+          userId: this.$store.state.user.userId,
+          flag: flag,
+          ...(() => {
+            if (this.pam.goodsId) {
+              return {
+                goodsId: this.pam.goodsId,
+              }
+            }
+            return {}
+          })(),
+          ...(() => {
+            if (this.pam.groupId) {
+              return {
+                groupId: this.pam.groupId,
+              }
+            }
+            return {}
+          })(),
+          ...(() => {
+            if (this.list.length) {
+              return {
+                id: this.list[flag ? 0 : this.list.length - 1].id
+              }
+            }
+            return {}
+          })(),
+        }, false).then(res => {
+          if (flag) {
+            this.list.unshift(...res.data)
+          } else {
+            this.list.push(...res.data)
+          }
+          cb && cb()
+        })
+      },
       upper() {
-        console.log("顶")
+        // console.log("顶")
+        uni.createSelectorQuery().select('.scrollviewDiv').boundingClientRect(data => {
+          var oldHeight = data.height
+          this.getMsgList(1, () => {
+            this.$nextTick(() => {
+              uni.createSelectorQuery().select('.scrollviewDiv').boundingClientRect(data2 => {
+                this.scrollTop = data2.height - oldHeight
+              }).exec()
+            })
+          })
+        }).exec()
       },
       lower() {
-        console.log("底")
+        // console.log("底")
       },
       scroll(e) {
         this.scrollTop = e.detail.scrollTop
       },
-    },
-    // #endif
-    // #ifndef H5
+      send() {
+        if (this.pam.goodsId && this.$store.state.user.userId && this.message) {
+          api.postJson('/user/talk/send', {
+            message: this.message,
+            userId: this.$store.state.user.userId,
+            goodsId: this.pam.goodsId,
+            ...(() => {
+              if (this.pam.groupId) {
+                return {
+                  groupId: this.pam.groupId,
+                }
+              }
+              return {}
+            })(),
+          }, false).then(res => {
+            this.message = ""
+            this.getNewList()
+          })
+        }
+      },
+      goFpzn(item) {
+        this.$navToPage({
+          url: '/pages/mine/parse?type=1'
+        })
+      },
+      // #endif
+      // #ifndef H5
 
-    // #endif
+      // #endif
+    },
   }
 </script>
 

+ 18 - 45
src/pages/mine/address/form.vue

@@ -50,13 +50,13 @@
 					<view class="r" @tap="getLocation"><text class="iconfont icon-dingwei1"></text>定位</view>
 				</view>
 			</view>
-			<view class="row">
+			<!-- <view class="row">
 				<view class="title">门牌号</view>
 				<view class="right input"><input type="text" placeholder="请输入门牌号" maxlength="15" v-model="formData.houseNo"></view>
-			</view>
+			</view> -->
 			<view class="row mt20">
 				<view class="title">设为默认</view>
-				<view class="right default"><switch @change="switchChange" color="#3D8FFD" v-model="formData.defaultAddr" :checked="formData.defaultAddr" style="transform:scale(0.7)" /></view>
+				<view class="right default"><switch @change="switchChange" color="#01C30B" v-model="formData.defaultAddr" :checked="formData.defaultAddr" style="transform:scale(0.7)" /></view>
 			</view>
 		</view>
 
@@ -70,7 +70,6 @@
 </template>
 
 <script>
-	import {mapState} from 'vuex';
 	import {getArea} from '@/common/utils/util.js';
 
 	export default {
@@ -88,16 +87,13 @@
 					area: '',
 					street: '',
 					address: '',
-					houseNo: '',
+					// houseNo: '',
 					defaultAddr: false,
 				},
 				canClickSave: true, // 能否点击提交
 				clipboard: '',
 			}
 		},
-		computed:{
-			...mapState(['userInfo', 'isLogin', 'userId'])
-		},
 		onLoad({id, addressData}) {
 			this.editId = id;
 			if(id) {
@@ -115,7 +111,7 @@
 					city: addressData.city,
 					area: addressData.area,
 					address: addressData.address,
-					houseNo: addressData.houseNo,
+					// houseNo: addressData.houseNo,
 					defaultAddr: addressData.defaultAddr,
 				}
 				this.regionValue = [addressData.province, addressData.city, addressData.area];
@@ -125,13 +121,8 @@
 		methods: {
 			async getRegion(address) {
 				const result = new Promise((resolve, reject) => {
-					this.$axios({
-						url: '/lbs/amap/region/query2',
-						method: 'post',
-						server: 'pc',
-						params: {
-							address
-						}
+					this.$api.post('/lbs/amap/region/query2', {
+						address
 					}).then(res => {
 						resolve(res.data);
 					})
@@ -242,15 +233,10 @@
 				return rs;
 			},
 
-
 			// 获取地址信息
 			getAddressData() {
-				this.$axios({
-					url: '/user/address/detail',
-					method: 'get',
-					params: {
-						userAddressId: this.editId
-					}
+				this.$api.get('/user/address/detail', {
+					userAddressId: this.editId
 				}).then(res => {
 					this.formData = {
 						name: res.data.name,
@@ -259,7 +245,7 @@
 						city: res.data.city,
 						area: res.data.area,
 						address: res.data.address,
-						houseNo: res.data.houseNo,
+						// houseNo: res.data.houseNo,
 						defaultAddr: res.data.defaultAddr,
 					}
 					this.regionValue = [res.data.province, res.data.city, res.data.area];
@@ -333,14 +319,10 @@
 
 			// 获取街道列表
 			getStreetList(street) {
-				this.$axios({
-					url: '/common/street',
-					method: 'get',
-					params: {
-						province: this.regionValue[0],
-						city: this.regionValue[1],
-						area: this.regionValue[2],
-					}
+				this.$api.get('/user/address/street', {
+          province: this.regionValue[0],
+          city: this.regionValue[1],
+          area: this.regionValue[2],
 				}).then(res => {
 					this.streetList = res.data;
 					if(street) {
@@ -409,7 +391,7 @@
 				if(!this.vailateData())return;
 
 				let params = this.formData;
-				params.userId = this.userId;
+				params.userId = this.$store.state.user.userId;
 				let url = '';
 				if(this.editId) {
 					params.userAddressId = this.editId;
@@ -417,12 +399,7 @@
 				}else {
 					url = '/user/address/save';
 				}
-				this.$axios({
-					url: url,
-					type: 'json',
-					params,
-					isLoading: 1,
-				}).then(res => {
+				this.$api.post(url, params).then(res => {
 					this.$successToast(this.editId? '编辑成功':'添加成功');
 					this.$backPage(1, 1000);
 				})
@@ -433,12 +410,8 @@
 				this.$modal({
 					content: '确定要删除该地址吗?',
 				}).then(() => {
-					this.$axios({
-						url: '/user/address/del',
-						params: {
-							userAddressId: this.editId
-						},
-						isLoading: 1,
+					this.$api.post('/user/address/del', {
+						userAddressId: this.editId
 					}).then(res => {
 						this.$successToast('删除成功');
 						this.$backPage(1, 1000);

+ 4 - 9
src/pages/mine/address/list.vue

@@ -12,7 +12,7 @@
 							<view class="default" v-if="item.defaultAddr">默认</view>
 							<view class="text">{{item.province}} {{item.city}} {{item.area}} {{item.street}}</view>
 						</view>
-						<view class="address">{{item.address}}{{item.houseNo}}</view>
+						<view class="address">{{item.address}}</view>
 						<view class="name">{{item.name}} {{item.phone}}</view>
 					</view>
 					<text class="iconfont icon-bianji" @tap.stop="$navPage('/pages/mine/address/form?id='+item.userAddressId)"></text>
@@ -36,8 +36,6 @@
 </template>
 
 <script>
-	import {mapState} from 'vuex';
-
 	export default {
 		data() {
 			return {
@@ -47,9 +45,6 @@
 				isChoose: false, // 是否进来选择地址
 			}
 		},
-		computed:{
-			...mapState(['userInfo', 'isLogin', 'userId'])
-		},
 		onShow() {
 			this.getList();
 		},
@@ -67,11 +62,11 @@
 			// 获取收货地址列表
 			getList() {
 				this.loadStatus = 1;
-				this.$api.get('/user/address/list', 
+				this.$api.get('/user/address/list',
           {
 						pageNum: 1,
 						pageSize: -1,
-						userId: this.userId
+						userId: this.$store.state.user.userId
 					}).then(res => {
 					this.loadStatus = 0;
 					let list = res.data.records;
@@ -101,7 +96,7 @@
 				uni.chooseAddress({
 					success(res) {
 						let params = {
-							userId: that.userId,
+							userId: that.$store.state.user.userId,
 							name: res.userName,
 							phone: res.telNumber,
 							province: res.provinceName,

+ 15 - 15
src/pages/mine/index.vue

@@ -16,8 +16,8 @@
           <view class="user">
             <image src="@/static/common/logo.png" mode="aspectFill"></image>
             <view class="main" v-if="isLogin">
-              <view class="name">张三</view>
-              <view class="real">实名认证</view>
+              <view class="name">微信用户</view>
+              <!-- <view class="real">实名认证</view> -->
             </view>
             <view class="main" v-else @tap="navToPage('/pages/login/indexs')">
               <view class="name">请先登录</view>
@@ -34,10 +34,10 @@
         <view class="stats-container card">
           <view class="top">
             <view class="left">我发布的</view>
-            <view class="right" @tap="$navPage(`/pages/mine/myIssue/list`)">全部<text class="iconfont icon-jinru"></text></view>
+            <view class="right" @tap="navToPage(`/pages/mine/myIssue/list?tab=`)">全部<text class="iconfont icon-jinru"></text></view>
           </view>
           <view class="stats">
-            <view class="item" v-for="(item, index) in issueStats" :key="index" @tap="$navPage(`/pages/mine/myIssue/list`)">
+            <view class="item" v-for="(item, index) in issueStats" :key="index" @tap="navToPage(`/pages/mine/myIssue/list?tab=${item.tab}`)">
               <view class="icon">
                 <text class="iconfont" :class="item.icon"></text>
                 <u-badge max="99" :value="item.num" :absolute="true" :offset="[-4, -4]"></u-badge>
@@ -50,10 +50,10 @@
         <view class="stats-container card">
           <view class="top">
             <view class="left">我买到的</view>
-            <view class="right" @tap="$navPage(`/pages/mine/myBuy/list`)">全部<text class="iconfont icon-jinru"></text></view>
+            <view class="right" @tap="navToPage(`/pages/mine/myBuy/list?tab=`)">全部<text class="iconfont icon-jinru"></text></view>
           </view>
           <view class="stats">
-            <view class="item" v-for="(item, index) in buyStats" :key="index" @tap="$navPage(`/pages/mine/myBuy/list`)">
+            <view class="item" v-for="(item, index) in buyStats" :key="index" @tap="navToPage(`/pages/mine/myBuy/list?tab=${item.tab}`)">
               <view class="icon">
                 <text class="iconfont" :class="item.icon"></text>
                 <u-badge max="99" :value="item.num" :absolute="true" :offset="[-4, -4]"></u-badge>
@@ -93,14 +93,14 @@ export default {
         { name: '我的收益', num: 0, url: '/pages/mine/myEarnings/list' },
       ],
       issueStats: [
-        { name: '我的发布', icon: 'icon-xiangji', num: 0 },
-        { name: '已卖出', icon: 'icon-xiangji', num: 0 },
-        { name: '已下架', icon: 'icon-xiangji', num: 0 },
+        { name: '我的发布', tab: 0, icon: 'icon-xiangji', num: 0 },
+        { name: '已卖出', tab: 1, icon: 'icon-xiangji', num: 0 },
+        { name: '已下架', tab: 2, icon: 'icon-xiangji', num: 0 },
       ],
       buyStats: [
-        { name: '待付款', icon: 'icon-xiangji', num: 0 },
-        { name: '待发货', icon: 'icon-xiangji', num: 0 },
-        { name: '待收货', icon: 'icon-xiangji', num: 0 },
+        { name: '待付款', tab: 1, icon: 'icon-xiangji', num: 0 },
+        { name: '待发货', tab: 2, icon: 'icon-xiangji', num: 0 },
+        { name: '待收货', tab: 3, icon: 'icon-xiangji', num: 0 },
       ],
 
       pageList: [
@@ -149,9 +149,9 @@ export default {
           userId: this.$store.state.user.userId,
         }).then(res => {
           if(!res.data) return false;
-          this.userStats[0].num = res.data.dz;
-          this.userStats[1].num = res.data.sc;
-          this.userStats[2].num = res.data.sy;
+          this.userStats[0].num = res.data.dz || 0;
+          this.userStats[1].num = res.data.sc || 0;
+          this.userStats[2].num = res.data.sy || 0;
         }).finally(res => {
           resolve(1);
         })

+ 107 - 37
src/pages/mine/myBuy/detail.vue

@@ -1,53 +1,123 @@
 <template>
-  <zj-page-layout
-  	:hasFooter="true"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh">
+  <!-- #ifdef H5 -->
+  <view>
+    <Loading
+    	:type="3"
+    	:loadStatus="loadStatus"
+    	:showText="errorText"
+    />
+    <zj-page-layout
+      v-if="detail"
+    	:hasFooter="true"
+    	:isScroll="true"
+    	:refresherTriggered="refresherTriggered"
+    	@refresherrefresh="refresherrefresh">
 
-    <view class="address-container">
-      <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
-      <view class="hasdata">
-        <view class="name">莫先生<text>13686123123</text></view>
-        <view class="address ellipsis-2">广东省广州市</view>
+      <view class="address-container">
+        <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
+        <view class="hasdata">
+          <view class="name">{{detail.userName}}<text>{{detail.phone}}</text></view>
+          <view class="address ellipsis-2">{{detail.address}}</view>
+        </view>
       </view>
-    </view>
 
-    <view class="goods-container">
-      <view class="title">商品信息</view>
-      <view class="goods">
-        <image src="@/static/user/other_book.png"></image>
-        <view class="main">
-          <view class="name">商品名称</view>
-          <view class="des">商品描述</view>
-          <view class="price"><text>¥18.00</text>x2</view>
+      <view class="goods-container">
+        <view class="title">商品信息</view>
+        <view class="goods">
+          <image :src="imageUrl + detail.goodsPicUrl"></image>
+          <view class="main">
+            <view class="name">{{detail.goodsTitle}}</view>
+            <view class="des">{{detail.content}}</view>
+            <view class="price"><text>{{detail.goodsAmount | priceFilter2}}</text>数量:{{detail.num}}</view>
+          </view>
         </view>
+        <view class="total">订单总金额<text>{{detail.price | priceFilter2}}</text></view>
       </view>
-      <view class="total">订单总金额<text>¥1200.00</text></view>
-    </view>
-
-    <view class="order-container">
-      <view class="title">订单信息</view>
-      <view class="row">订单编号:1234321232</view>
-      <view class="row">创建时间:1234321232</view>
-      <view class="row">付款时间:1234321232</view>
-      <view class="row">支付方式:1234321232</view>
-      <view class="row">支付单号:1234321232</view>
-      <view class="row">发货时间:1234321232</view>
-      <view class="row">收货时间:1234321232</view>
-    </view>
 
-    <template slot="footer">
-      <view class="bottom-container">
-        <u-button text="取消订单" shape="circle"></u-button>
+      <view class="order-container">
+        <view class="title">订单信息</view>
+        <view class="row">订单编号:{{detail.orderId}}</view>
+        <view class="row">创建时间:{{detail.createTime}}</view>
+        <view class="row">付款时间:{{detail.payTime}}</view>
+        <view class="row">支付方式:{{detail.payType | payTypeFilter}}</view>
+        <view class="row">支付单号:{{detail.transactionId}}</view>
+        <view class="row">发货时间:{{detail.logisticsTime}}</view>
+        <view class="row">收货时间:{{detail.completeTime}}</view>
       </view>
-    </template>
 
-  </zj-page-layout>
+      <template slot="footer">
+        <view class="bottom-container">
+          <u-button text="取消订单" shape="circle"></u-button>
+        </view>
+      </template>
+
+    </zj-page-layout>
+  </view>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref('/pages/mine/myBuy/detail', pam)"></web-view>
+  <!-- #endif -->
 </template>
 
 <script>
+  // #ifdef H5
+  export default {
+    filters: {
+      payTypeFilter(val) {
+        const MAP = {
+          WECHAT: '微信支付'
+        }
+        return MAP[val];
+      }
+    },
+
+    data() {
+      return {
+        id: null,
+        detail: null,
+        imageUrl: this.$imageUrl,
+        loadStatus: 0,
+				errorText: '',
+        refresherTriggered: false,
+      }
+    },
 
+    onLoad({id}) {
+      this.id = id;
+      this.getDetail();
+    },
+
+    methods: {
+      getDetail() {
+        this.$api.post('/orderPay/detail', {
+          orderId: this.id
+        }).then(res => {
+					this.detail = res.data;
+					this.loadStatus = 0;
+					this.getLogisticsData();
+				}).catch(res => {
+					this.errorText = res.message;
+					this.loadStatus = 2;
+				}).finally(res => {
+					this.refresherTriggered = false;
+				})
+      }
+    }
+  }
+  // #endif
+  // #ifndef H5
+  export default {
+    data() {
+      return {
+        pam: {},
+      }
+    },
+  
+    onLoad(pam) {
+      this.pam = pam;
+    },
+  }
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 68 - 21
src/pages/mine/myBuy/list.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- #ifdef H5 -->
   <zj-page-layout
   	:hasFooter="false"
   	:isScroll="true"
@@ -10,7 +11,7 @@
         <u-tabs
         	:scrollable="false"
         	:list="tabList"
-        	:current="curTab"
+        	:current="tabCurrent"
         	@click="changeTab"
         	lineColor="#01C30B"
         	:activeStyle="{
@@ -25,41 +26,60 @@
     </template>
 
     <view class="common-order-list">
-      <view class="item" @tap="$navPage(`/pages/mine/myBuy/detail`)">
+      <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.orderId)">
         <view class="top">
           <image src="@/static/common/logo.png"></image>
           <view class="user">
-            <view class="name">李海</view>
-            <view class="time">21小时前发布</view>
+            <view class="name">{{item.userName}}</view>
+            <view class="time">{{item.goodsCreateTime}}</view>
           </view>
-          <view class="status">待付款</view>
+          <view class="status">{{item.status | statusFilter}}</view>
         </view>
         <view class="goods">
-          <image src="@/static/user/other_book.png"></image>
+          <image :src="imageUrl + item.goodsPicUrl"></image>
           <view class="main">
-            <view class="name">商品名称</view>
-            <view class="des">商品描述</view>
-            <view class="price"><text>¥18.00</text>x2</view>
+            <view class="name">{{item.goodsTitle}}</view>
+            <view class="des">{{item.content}}</view>
+            <view class="price"><text>{{item.goodsAmount | priceFilter2}}</text>数量:{{item.num}}</view>
           </view>
         </view>
-        <view class="total">订单总金额<text>¥1200.00</text></view>
+        <view class="total">订单总金额<text>{{item.price | priceFilter2}}</text></view>
         <view class="bottom">
-          <view class="left-location"><text class="iconfont icon-dingwei"></text>天河区棠下</view>
-          <view class="right-btn">
+          <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
+          <view class="right-btn" @tap.stop>
             <u-button text="取消订单" shape="circle"></u-button>
           </view>
         </view>
       </view>
     </view>
 
+    <Loading :loadStatus="loadStatus" :dataList="dataList" />
+
   </zj-page-layout>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref(`/pages/mine/myBuy/list`, pam)"></web-view>
+  <!-- #endif -->
 </template>
 
 <script>
+  // #ifdef H5
   export default {
+    filters: {
+      statusFilter(val) {
+        const MAP = {
+          WAIT: '待支付',
+          WAIT_SEND: '待发货',
+          SEND: '已发货',
+          COMPLETE: '已完成',
+        }
+        return MAP[val];
+      }
+    },
+
     data() {
       return {
-        imgUrl: this.$imageUrl,
+        imageUrl: this.$imageUrl,
         tabList: [
           {name: '全部', value: 1},
           {name: '待付款', value: 2},
@@ -68,23 +88,30 @@
           {name: '已收货', value: 5},
           {name: '售后中', value: 6},
         ],
-        curTab: 0,
+        tabCurrent: 0,
         dataList: [],
         pageNum: 1,
+        loadStatus: 0,
         refresherTriggered: false,
       }
     },
 
-    async onLoad() {
-      // await this.getList()
+    async onLoad({tab}) {
+      this.tabCurrent = tab ? Number(tab) : 0;
+      await this.getList();
     },
 
     methods: {
       //获取列表数据
       async getList() {
-        this.$api.post('/xxx/xxxlist', {
+        this.$api.post('/orderPay/list', {
           pageNum: this.pageNum,
           pageSize: 10,
+          params: [{
+            param: 'a.user_id',
+            compare: '=',
+            value: this.$store.state.user.userId
+          }]
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
@@ -93,10 +120,10 @@
           }
           this.dataList = this.dataList.concat(list);
         }).catch(() => {
-					this.loadStatus = 2;
-				}).finally(res => {
-					this.refresherTriggered = false;
-				})
+      		this.loadStatus = 2;
+      	}).finally(res => {
+      		this.refresherTriggered = false;
+      	})
       },
 
       // 滚动到底部
@@ -115,8 +142,28 @@
       	this.getList();
       },
 
+      toDetail(id) {
+        this.$navToPage({
+          url: `/pages/mine/myBuy/detail?id=${id}`
+        })
+      },
+
     }
   }
+  // #endif
+  // #ifndef H5
+  export default {
+    data() {
+      return {
+        pam: {},
+      }
+    },
+
+    onLoad(pam) {
+      this.pam = pam;
+    },
+  }
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 0 - 175
src/pages/mine/myIssue/detail.vue

@@ -1,175 +0,0 @@
-<template>
-  <zj-page-layout
-  	:hasFooter="true"
-  	:isScroll="true"
-  	:refresherTriggered="refresherTriggered"
-  	@refresherrefresh="refresherrefresh">
-
-    <view class="address-container">
-      <view class="icon"><text class="iconfont icon-dingwei1"></text></view>
-      <view class="hasdata">
-        <view class="name">莫先生<text>13686123123</text></view>
-        <view class="address ellipsis-2">广东省广州市</view>
-      </view>
-    </view>
-
-    <view class="goods-container">
-      <view class="title">商品信息</view>
-      <view class="goods">
-        <image src="@/static/user/other_book.png"></image>
-        <view class="main">
-          <view class="name">商品名称</view>
-          <view class="des">商品描述</view>
-          <view class="price"><text>¥18.00</text>x2</view>
-        </view>
-      </view>
-      <view class="total">订单总金额<text>¥1200.00</text></view>
-    </view>
-
-    <view class="order-container">
-      <view class="title">订单信息</view>
-      <view class="row">订单编号:1234321232</view>
-      <view class="row">创建时间:1234321232</view>
-      <view class="row">付款时间:1234321232</view>
-      <view class="row">支付方式:1234321232</view>
-      <view class="row">支付单号:1234321232</view>
-      <view class="row">发货时间:1234321232</view>
-      <view class="row">收货时间:1234321232</view>
-    </view>
-
-    <template slot="footer">
-      <view class="bottom-container">
-        <u-button text="取消订单" shape="circle"></u-button>
-      </view>
-    </template>
-
-  </zj-page-layout>
-</template>
-
-<script>
-
-</script>
-
-<style lang="scss" scoped>
-.address-container {
-  background: #FFFFFF;
-  display: flex;
-  align-items: center;
-  height: 150rpx;
-  padding: 0 20rpx;
-  margin-top: 30rpx;
-  .icon {
-    width: 52rpx;
-    height: 52rpx;
-    border-radius: 50%;
-    background: $theme-color;
-    display: flex;
-    flex-shrink: 0;
-    justify-content: center;
-    align-items: center;
-    margin-right: 20rpx;
-    .iconfont {
-      font-size: 36rpx;
-      color: #ffffff;
-    }
-  }
-  .hasdata {
-    .name {
-      font-size: 32rpx;
-      color: #333333;
-      text {
-        color: #999999;
-        font-size: 28rpx;
-        margin-left: 16rpx;
-      }
-    }
-    .address {
-      font-size: 28rpx;
-      color: #666666;
-      line-height: 34rpx;
-      margin-top: 10rpx;
-    }
-  }
-}
-
-.goods-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx 30rpx 0;
-  .title {
-    font-weight: 500;
-  }
-  .goods {
-    display: flex;
-    padding: 30rpx 0;
-    image {
-      width: 120rpx;
-      height: 120rpx;
-    }
-    .main {
-      flex: 1;
-      margin-left: 20rpx;
-      .name {
-        font-size: 32rpx;
-      }
-      .des {
-        margin-top: 12rpx;
-        font-size: 28rpx;
-        color: $reg-font;
-      }
-      .price {
-        margin-top: 12rpx;
-      	text {
-      		color: $assist-color;
-      		font-weight: 500;
-      		font-size: 32rpx;
-          margin-right: 12rpx;
-      	}
-      }
-    }
-  }
-  .total {
-    border-top: 1px solid #eaeaea;
-    height: 80rpx;
-    display: flex;
-    align-items: center;
-    justify-content: end;
-    font-size: 28rpx;
-    text {
-      margin-left: 12rpx;
-      color: $assist-color;
-    }
-  }
-}
-
-.order-container {
-  background: #ffffff;
-  margin-top: 30rpx;
-  padding: 30rpx;
-  .title {
-    font-weight: 500;
-    margin-bottom: 20rpx;
-  }
-  .row {
-    margin-top: 12rpx;
-    font-size: 28rpx;
-    text {
-      color: $assist-color;
-    }
-  }
-}
-
-.bottom-container {
-  padding: 20rpx 30rpx;
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  .u-button {
-    width: auto;
-    height: 60rpx;
-    margin: 0;
-    margin-left: 20rpx;
-  }
-}
-
-</style>

+ 98 - 26
src/pages/mine/myIssue/list.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- #ifdef H5 -->
   <view>
     <zj-page-layout
       :hasFooter="false"
@@ -11,8 +12,8 @@
           <u-tabs
             :scrollable="false"
             :list="tabList"
-            :current="curTab"
-            @click="changeTab"
+            :current="tabCurrent"
+            @click="clickTab"
             lineColor="#01C30B"
             :activeStyle="{
               color: '#01C30B'
@@ -26,32 +27,34 @@
       </template>
 
       <view class="common-order-list">
-        <view class="item" @tap="$navPage(`/pages/mine/myBuy/detail`)">
+        <view class="item" v-for="(item, index) in dataList" :key="index" @tap="toDetail(item.id)">
           <view class="top">
             <image src="@/static/common/logo.png"></image>
             <view class="user">
-              <view class="name">李海</view>
-              <view class="time">21小时前发布</view>
+              <view class="name">{{item.userName}}</view>
+              <view class="time">{{item.goodsCreateTime}}</view>
             </view>
-            <view class="status">待付款</view>
+            <view class="status">{{item.status | statusFilter}}</view>
           </view>
           <view class="goods">
-            <image src="@/static/user/other_book.png"></image>
+            <image :src="imageUrl + item.goodsPicUrl"></image>
             <view class="main">
-              <view class="name">商品名称</view>
-              <view class="des">商品描述</view>
-              <view class="price"><text>¥18.00</text>x2</view>
+              <view class="name">{{item.title}}</view>
+              <view class="des">{{item.content}}</view>
+              <view class="price"><text>{{item.amount | priceFilter2}}</text></view>
             </view>
           </view>
           <view class="bottom">
-            <view class="left-location"><text class="iconfont icon-dingwei"></text>天河区棠下</view>
+            <view class="left-location"><text class="iconfont icon-dingwei"></text>{{item.address}}</view>
             <view class="right-btn" @tap.stop>
-              <u-button text="确认发货" shape="circle" @click="openDeliver()"></u-button>
+              <u-button text="确认发货" shape="circle" @click="openDeliver(item.id)"></u-button>
             </view>
           </view>
         </view>
       </view>
 
+      <Loading :loadStatus="loadStatus" :dataList="dataList" />
+
     </zj-page-layout>
 
     <zj-dialog-deliver
@@ -60,9 +63,14 @@
       @close="isShowDeliverDialog = false">
     </zj-dialog-deliver>
   </view>
+  <!-- #endif -->
+  <!-- #ifndef H5 -->
+  <web-view :src="webViewHref(`/pages/mine/myIssue/list`, pam)"></web-view>
+  <!-- #endif -->
 </template>
 
-<script>
+<script>
+  // #ifdef H5
 	import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
 
   export default {
@@ -70,33 +78,63 @@
       zjDialogDeliver
     },
 
+    filters: {
+      statusFilter(val) {
+        const MAP = {
+          1: '上架中',
+          2: '已转让',
+          0: '已下架',
+          3: '已冻结',
+          4: '已卖出',
+        }
+        return MAP[val];
+      }
+    },
+
     data() {
       return {
-        imgUrl: this.$imageUrl,
+        imageUrl: this.$imageUrl,
         tabList: [
-          {name: '我发布的', value: 1},
-          {name: '已卖出', value: 2},
-          {name: '已下架', value: 3},
+          {name: '我发布的', value: 0},
+          {name: '已卖出', value: 1},
+          {name: '已下架', value: 2},
         ],
-        curTab: 0,
+        tabCurrent: 0,
         dataList: [],
         pageNum: 1,
+        loadStatus: 0,
         refresherTriggered: false,
 
         isShowDeliverDialog: false,
       }
     },
 
-    async onLoad() {
-      // await this.getList()
+    async onLoad({tab}) {
+      this.tabCurrent = tab ? Number(tab) : 0;
+      await this.getList();
+
+      uni.$on('refreshMyIssueList', () => {
+        this.refreshLish();
+      })
+    },
+
+    onUnload() {
+      uni.$off('refreshMyIssueList');
     },
 
     methods: {
       //获取列表数据
       async getList() {
-        this.$api.post('/xxx/xxxlist', {
+        const statusMap = {
+          0: 1,
+          1: 4,
+          2: 0
+        }
+        this.$api.get('/goods/list', {
           pageNum: this.pageNum,
           pageSize: 10,
+          status: statusMap[this.tabCurrent],
+          userId: this.$store.state.user.userId
         }).then(res => {
           this.loadStatus = 0;
           let list = res.data.records;
@@ -122,18 +160,52 @@
       // 触发下拉刷新
       refresherrefresh(e) {
       	this.refresherTriggered = true;
-      	this.dataList = [];
-      	this.pageNum = 1;
-      	this.getList();
+      	this.refreshLish();
+      },
+
+      refreshLish() {
+        this.dataList = [];
+        this.pageNum = 1;
+        this.getList();
+      },
+
+      clickTab(item) {
+        this.tabCurrent = item.value;
+        this.refreshLish();
+      },
+
+      toDetail(id) {
+        this.$navToPage({
+          url: `/pages/goods/detail?id=${id}`
+        })
       },
 
-      openDeliver() {
-        this.$refs.deliverDialog.setValue();
+      openDeliver(id) {
+        this.$refs.deliverDialog.setValue(id);
         this.isShowDeliverDialog = true;
       }
 
     }
   }
+  // #endif
+  // #ifndef H5
+  import zjDialogDeliver from '@/components/zj-dialog/zj-dialog-deliver.vue';
+
+  export default {
+    components: {
+      zjDialogDeliver
+    },
+    data() {
+      return {
+        pam: {},
+      }
+    },
+    
+    onLoad(pam) {
+      this.pam = pam;
+    },
+  }
+  // #endif
 </script>
 
 <style lang="scss" scoped>

+ 12 - 3
src/pages/mine/parse.vue

@@ -10,7 +10,7 @@
   </zj-page-layout>
   <!-- #endif -->
   <!-- #ifndef H5 -->
-  <web-view :src="webViewHref('/pages/mine/parse')"></web-view>
+  <web-view :src="webViewHref(`/pages/mine/parse`, pam)"></web-view>
   <!-- #endif -->
 </template>
 
@@ -54,10 +54,19 @@
 			},
 		},
 	}
-  
+
   // #endif
   // #ifndef H5
-  
+  export default {
+    data() {
+      return {
+        pam: {},
+      }
+    },
+    onLoad(pam) {
+      this.pam = pam;
+    }
+  }
   // #endif
 </script>
 

+ 1 - 0
src/store/getters.js

@@ -3,6 +3,7 @@ const getters = {
   openId: state => state.user.openId,
   name: state => state.user.name,
   avatar: state => state.user.avatar,
+  userId: state => state.user.userId,
 }
 
 

+ 1 - 0
src/store/modules/user/actions.js

@@ -33,6 +33,7 @@ export default {
       commit("set_openId", "")
       commit("set_name", "")
       commit("set_avatar", "")
+      commit("set_userId", "")
       resolve()
     })
   },

+ 10 - 1
src/store/modules/user/index.js

@@ -35,6 +35,14 @@ var useravatar = getQueryVariable("useravatar")
 if (useravatar) {
   uni.setStorageSync('recycle_mobile_avatar', useravatar)
 }
+var userId = getQueryVariable("userId")
+if (userId) {
+  uni.setStorageSync('recycle_mobile_userId', userId)
+}
+var miniProgram = getQueryVariable("miniProgram")
+if (miniProgram) {
+  uni.setStorageSync('miniProgram', miniProgram)
+}
 // #endif
 
 const state = {
@@ -42,10 +50,11 @@ const state = {
   token: uni.getStorageSync('recycle_mobile_token') || '',
   name: uni.getStorageSync('recycle_mobile_name') || '',
   avatar: uni.getStorageSync('recycle_mobile_avatar') || '',
+  userId: uni.getStorageSync('recycle_mobile_userId') || '',
 }
 export default {
   namespaced: true,
   state,
   mutations,
   actions
-}
+}

+ 9 - 0
src/store/modules/user/mutations.js

@@ -9,6 +9,15 @@ export default {
     }
   },
 
+  set_userId: (state, userId) => {
+    state.userId = userId
+    if (userId) {
+      uni.setStorageSync('recycle_mobile_userId', userId)
+    } else {
+      uni.removeStorageSync("recycle_mobile_userId")
+    }
+  },
+
   set_openId: (state, openId) => {
     state.openId = openId
     if (openId) {