|
@@ -67,25 +67,31 @@ Page({
|
|
|
},
|
|
|
goSaoMa() {
|
|
|
console.log("扫阿");
|
|
|
- // 允许从相机和相册扫码
|
|
|
- wx.scanCode({
|
|
|
- onlyFromCamera: true,
|
|
|
- success: (res) => {
|
|
|
- console.log(res, "打印锕");
|
|
|
- let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
|
|
|
- wx.navigateTo({
|
|
|
- url: '/pages/love/love?id=' + length,
|
|
|
- })
|
|
|
- },
|
|
|
- fail: (res) => {
|
|
|
- console.log(res, "假的");
|
|
|
- wx.showToast({
|
|
|
- title: '扫码失败',
|
|
|
- icon: 'none',
|
|
|
- duration: 2000,
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (wx.getStorageSync('user') == '') {
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/login/login',
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.scanCode({
|
|
|
+ onlyFromCamera: true,
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, "打印锕");
|
|
|
+ let length = res.result.substring(res.result.lastIndexOf('/') + 1, res.result.length)
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/love/love?id=' + length,
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: (res) => {
|
|
|
+ console.log(res, "假的");
|
|
|
+ wx.showToast({
|
|
|
+ title: '扫码失败',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
depts() {
|
|
|
console.log("打印走了么的接口呢");
|
|
@@ -118,7 +124,7 @@ Page({
|
|
|
success: (res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
console.log(res);
|
|
|
- if(res.data.data.length!=0){
|
|
|
+ if (res.data.data.length != 0) {
|
|
|
let result = res.data.data[0].title
|
|
|
this.data.msgList.push({
|
|
|
title: result
|
|
@@ -173,7 +179,7 @@ Page({
|
|
|
console.log("onshowssshshshhshshshss");
|
|
|
this.depts();
|
|
|
this.welcomeMessage();
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
onLoad: function () {
|
|
|
console.log("onload11111111111111111111111");
|
|
@@ -186,5 +192,5 @@ Page({
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
})
|