瀏覽代碼

[分享,编辑][修改]:修改分享和编辑

tags/2.2.4
meo 6 年之前
父節點
當前提交
70eec5b1f8
共有 4 個文件被更改,包括 16 次插入9 次删除
  1. +1
    -3
      pages/coupon/detail/index.js
  2. +1
    -3
      pages/edit/edit.js
  3. +1
    -1
      pages/edit/edit.wxml
  4. +13
    -2
      pages/index/index.js

+ 1
- 3
pages/coupon/detail/index.js 查看文件

@@ -17,8 +17,6 @@ Page({
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo'),


id: '',
result: [],
end_time: '',
@@ -402,7 +400,7 @@ Page({
console.log(options)
var eData = options.target.dataset.id;
var couponId = options.target.dataset.couponid;
shareObj.path = `/pages/coupon/detail/index?couponChannelId=${eData}&couponId=${couponId}`;
shareObj.path = `/pages/index/index?couponChannelId=${eData}&couponId=${couponId}`;
}
// 返回shareObj
return shareObj;


+ 1
- 3
pages/edit/edit.js 查看文件

@@ -65,6 +65,7 @@ Page({
else {
var address = null;
}
console.log(e.detail.value.username)
if (e.detail.value.username) {
var username = e.detail.value.username;
} else if (that.data.username) {
@@ -136,8 +137,6 @@ Page({
flag: 2
});
if (options.sex == "1") {
console.log(that.data.items);
that.data.items[0].checked = true;
var checked = 'items[' + 0 + '].checked'
that.setData({
[checked]: true
@@ -146,7 +145,6 @@ Page({
flagsex: 1
})
} else if (options.sex == "2") {
that.data.items[1].checked = true;
var checked = 'items[' + 1 + '].checked'
that.setData({
[checked]: true


+ 1
- 1
pages/edit/edit.wxml 查看文件

@@ -1,7 +1,7 @@
<form bindsubmit="formSubmit">
<view class='section'>
<text>姓名</text>
<input wx:if="{{username}}" type="text" placeholder='{{username}}'/>
<input wx:if="{{username}}" name="username" type="text" placeholder='{{username}}'/>
<input wx:if="{{!username}}" type="text" placeholder='请填写名字' disabled/>
</view>
<view class="section sec">


+ 13
- 2
pages/index/index.js 查看文件

@@ -28,6 +28,8 @@ Page({
*/
onLoad: function(options) {
var that = this;
console.log(options);
console.log("这是options")
var scene = decodeURIComponent(options.scene);
that.setData({
scene:scene
@@ -35,7 +37,11 @@ Page({
console.log(that.data.scene)
console.log(scene);
app.getLocation();
that.userLogin();
if (options.couponChannelId && options.couponId){
that.userLogin(options.couponChannelId, options.couponId);
}else{
that.userLogin()
}
Http.get({
url: config.api.getWeapNote,
data: {
@@ -88,7 +94,7 @@ Page({
/**
* 用户登录
*/
userLogin: function() {
userLogin: function (couponChannelId,couponId) {
var that = this;
// 登录
wx.login({
@@ -127,6 +133,11 @@ Page({
})
.then(res => {
app.globalData.token = res.data.token;
if (res.data.token && couponChannelId && couponId){
wx.navigateTo({
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`,
})
}
if (res.data.token){
that.setData({
showGame: true


Loading…
取消
儲存