You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
1.7 KiB

// pages/quest/subpage/detail/components/link/link.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
platforms: [{
id: 1,
name: '抖音'
}, {
id: 2,
name: '快手'
}, {
id: 3,
name: '朋友圈'
}, {
id: 4,
name: '视频号'
}],
platform: null,
platformdia: false,
link: '',
host: getApp().globalData.host,
link_type: false
},
/**
* 组件的方法列表
*/
methods: {
plachoose(e) {
this.setData({
platformdia: true
})
},
plachoose2(e) {
console.log(e.currentTarget.dataset.mes)
if (e.currentTarget.dataset.mes.id === 3) {
this.setData({
link_type: true
})
} else {
this.setData({
link_type: false
})
}
this.setData({
platform: e.currentTarget.dataset.mes,
platformdia: false
})
},
linkin(e) {
console.log(e.detail.value)
this.setData({
link: e.detail.value
})
},
up(e) {
console.log(this.data.platform, this.data.link)
},
chooseImage() {
let that = this
wx.chooseImage({
success(res) {
const tempFilePaths = res.tempFilePaths
// console.log(res)
wx.uploadFile({
url: that.data.host + '/util/upload',
filePath: tempFilePaths[0],
name: 'file',
// formData: {
// '11111111': 'test'
// },
success(res) {
const data = res.data
console.log(res)
//do something
}
})
}
})
}
}
})