master
Tuisku 3 years ago
parent e37f88ebc0
commit bd39d8bf79

@ -1,5 +1,6 @@
// app.js
import {host,cdn} from "./utils/config"
import {http} from './utils/util'
App({
onLaunch() {
// 展示本地存储能力
@ -10,7 +11,41 @@ App({
// 登录
wx.login({
success: res => {
// 发送 res.code 到后台换取 openId, sessionKey, unionId
// this.setData({
// code: res.code
// })
http("/user/login", "post", {
code: res.code
}).then(res => {
if (res.msg === "未注册!") {
// this.getUserProfile()
wx.showToast({
title: '您尚未注册,请点击个人头像位置以注册登录',
icon: 'none',
duration: 2000
})
} else {
getApp().globalData.token = res.data.token
// this.setData({
// user_avatar:res.data.user.avatar,
// user_name:res.data.user.name,
// user_tip:'欢迎来到星途~'
// })
wx.setStorage({
key: 'user',
data: res.data.user
})
wx.setStorage({
key: 'token',
data: res.data.token
})
// wx.getStorage({
// key: 'token',
// success (res) {
// }
// })
}
})
}
})
},

@ -42,6 +42,7 @@ Component({
},
// 用户点击确定触发
handleConfirm() {
console.log('handleConfirm', this.data.inputValue)
this.triggerEvent('handleSearch', this.data.inputValue)
}
}

@ -3,21 +3,14 @@
<view class="content">
<!-- <image src="../../assets/images/search.png" class="search-icon"></image> -->
<l-icon name="research" color="#D0D0D0" size="30"></l-icon>
<input
bindinput="handleInput"
bindconfirm="handleConfirm"
type="text"
value="{{inputValue}}"
placeholder="{{placeholder}}"
class="input"
confirm-type="search"
></input>
<image
<input bindinput="handleInput" bindconfirm="handleConfirm" type="text" value="{{inputValue}}" placeholder="{{placeholder}}" class="input" confirm-type="search"></input>
<!-- <image
wx:if="{{inputValue}}"
bindtap="handleDeleteClick"
src="../../assets/images/delete-circle.png"
class="delete-icon"
></image>
></image> -->
<l-icon name="close" class="delete-icon" wx:if="{{inputValue}}" bindtap="handleDeleteClick" color="#D0D0D0" size="30"></l-icon>
</view>
<view wx:if="{{inputValue}}" bindtap="handleTextbtnClick" class="text-btn">取消</view>
</view>

@ -1,12 +1,11 @@
<!--pages/lookup/lookimg/img.wxml-->
<!--utils/video/video.wxml-->
<view class="main">
<image style="width: 100%;" src="{{cdn+data.fileUrl}}"></image>
<image mode="widthFix" style="width: 750rpx;" src="{{cdn+data.fileUrl}}"></image>
<view class="bottom">
<view class="title">{{data.title}}</view>
<view class="cards">
<view class="card">星途追风</view>
<view class="card">星途凌云</view>
<view class="card" wx:for="{{data.brandList}}"></view>
</view>
<view class="operation">
<button class="one" plain="{{true}}" open-type="share">

@ -24,27 +24,6 @@ Page({
rank: [{
name: '全部标签',
is: true
}, {
name: '产品宣传',
is: false
}, {
name: '媒体测评',
is: false
}, {
name: '用户活动',
is: false
}, {
name: '趣味互动',
is: false
}, {
name: '用户互动',
is: false
}, {
name: '媒体测评',
is: false
}, {
name: '趣味活动',
is: false
}]
}, {
id: 1,
@ -69,27 +48,6 @@ Page({
rank: [{
name: '全部车型',
is: true
}, {
name: '星途追风ET-I',
is: false
}, {
name: '星途追风',
is: false
}, {
name: '星途TX',
is: false
}, {
name: '星途凌云',
is: false
}, {
name: '星途凌云S',
is: false
}, {
name: '星途揽月',
is: false
}, {
name: '揽月探享版至尊享受',
is: false
}]
}],
// 下拉选项被选中那组的数据由下面的js控制赋值
@ -115,6 +73,7 @@ Page({
backgroundColor: '#F9F9F9',
})
this.getdata()
// http("/douyin/code", "post",{}).then(res=>{})
},
to (e) {
wx.navigateTo({
@ -129,6 +88,27 @@ Page({
questes:res.data.records
})
})
http("/brand/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
let a = element
this.setData({
'selectItem[2].rank': this.data.selectItem[2].rank.concat(a)
})
});
})
http("/tag/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
element.name = element.title
let a = element
this.setData({
'selectItem[0].rank': this.data.selectItem[0].rank.concat(a)
})
});
})
},
// 点击菜单栏触发的事件函数
handleClick: function (e) {

@ -28,28 +28,7 @@ Page({
rank: [{
name: '全部标签',
is: true
}, {
name: '产品宣传',
is: false
}, {
name: '媒体测评',
is: false
}, {
name: '用户活动',
is: false
}, {
name: '趣味互动',
is: false
}, {
name: '用户互动',
is: false
}, {
name: '媒体测评',
is: false
}, {
name: '趣味活动',
is: false
}]
},]
}, {
id: 1,
rank: [{
@ -73,27 +52,6 @@ Page({
rank: [{
name: '全部车型',
is: true
}, {
name: '星途追风ET-I',
is: false
}, {
name: '星途追风',
is: false
}, {
name: '星途TX',
is: false
}, {
name: '星途凌云',
is: false
}, {
name: '星途凌云S',
is: false
}, {
name: '星途揽月',
is: false
}, {
name: '揽月探享版至尊享受',
is: false
}]
}],
// 下拉选项被选中那组的数据由下面的js控制赋值
@ -122,6 +80,27 @@ Page({
title: options.name,
success: function (res) {}
})
http("/brand/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
let a = element
this.setData({
'selectItem[2].rank': this.data.selectItem[2].rank.concat(a)
})
});
})
http("/tag/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
element.name = element.title
let a = element
this.setData({
'selectItem[0].rank': this.data.selectItem[0].rank.concat(a)
})
});
})
},
getmore () {
this.setData({
@ -177,13 +156,13 @@ Page({
})
},
to(e) {
// if (this.data.choose) {} else {
if (this.data.choose) {} else {
// wx.navigateTo({
// url: e.currentTarget.dataset.url,
// })
// }
// console.log(e.currentTarget.dataset.item)
lookup(e.currentTarget.dataset.item)
}
// lookup(e.currentTarget.dataset.item)
},
// 点击菜单栏触发的事件函数
handleClick: function (e) {
@ -267,29 +246,31 @@ Page({
let a = e.currentTarget.dataset.data.index
let b = e.currentTarget.dataset.index
let c = 'listdata[' + a + '].refrence[' + b + '].choose'
this.setData({
[c] : !this.data.listdata[a].refrence[b].choose
})
let flag = true
for (let i = 0; i < this.data.listdata[a].refrence.length; i++) {
if (this.data.listdata[a].refrence[i].choose) {
} else {
flag = false
}
}
if (flag) {
// this.data.listdata[a].all = true
let d = 'listdata[' + a + '].all'
this.setData({
[d]: true
})
} else {
// this.data.listdata[a].all = false
let d = 'listdata[' + a + '].all'
this.setData({
[d]: false
})
}
console.log(this.data,a,b)
// this.setData({
// [c] : !this.data.listdata[a].refrence[b].choose
// })
// let flag = true
// for (let i = 0; i < this.data.listdata[a].refrence.length; i++) {
// if (this.data.listdata[a].refrence[i].choose) {
// } else {
// flag = false
// }
// }
// if (flag) {
// // this.data.listdata[a].all = true
// let d = 'listdata[' + a + '].all'
// this.setData({
// [d]: true
// })
// } else {
// // this.data.listdata[a].all = false
// let d = 'listdata[' + a + '].all'
// this.setData({
// [d]: false
// })
// }
},
chooseall (e) {
let a = 'listdata[' + e.currentTarget.dataset.index + '].all'

@ -26,8 +26,8 @@
<button class="allin" wx:if="{{choose}}" data-index="{{index}}" bindtap="chooseall">{{item.all?'全不选':'全选'}}</button>
</view>
<view class="cards">
<!-- <view class="card" wx:for="{{item.refrence}}" wx:key="index" data-item="{{item}}" data-in="{{index}}" data-url="/pages/lookup/loockvideo/video" bindtap="to" capture-bind:longtap="tochoose"> -->
<view class="card" wx:for="{{item.refrence}}" wx:key="index" data-item="{{item}}" data-in="{{index}}" bindtap="to">
<view class="card" wx:for="{{item.refrence}}" wx:key="index" data-item="{{item}}" data-in="{{index}}" data-url="/pages/lookup/loockvideo/video" bindtap="to" capture-bind:longtap="tochoose">
<!-- <view class="card" wx:for="{{item.refrence}}" wx:key="index" data-item="{{item}}" data-in="{{index}}" bindtap="to"> -->
<!-- 封面图片 -->
<image mode="aspectFill" style="width: 144rpx;height: 144rpx;border-radius: 8rpx;" src="{{item.type===1?cdn+item.coverUrl:cdn+item.fileUrl}}"></image>
<!-- 左下角播放时长 -->

@ -182,7 +182,7 @@
background: rgba(0, 0, 0, 0.3);
border: 2rpx solid #FFFFFF;
position: relative;
bottom: 93rpx;
bottom: 140rpx;
left: 100rpx;
border-radius: 32rpx;
}
@ -193,7 +193,7 @@
background: #006BFF;
border: 2rpx solid #FFFFFF;
position: relative;
bottom: 93rpx;
bottom: 140rpx;
left: 100rpx;
border-radius: 32rpx;
}

@ -92,27 +92,9 @@ Page({
success: function (res) {}
})
this.getdata()
http("/brand/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
element.title = element.name
let a = element
this.setData({
'selectItem[3].rank': this.data.selectItem[3].rank.concat(a)
})
});
})
http("/tag/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
let a = element
this.setData({
'selectItem[1].rank': this.data.selectItem[1].rank.concat(a)
})
});
})
},
handleSearch (b) {
console.log(b)
},
to(e) {
wx.navigateTo({
@ -143,6 +125,27 @@ Page({
'maxpage': res.data.pages,
})
})
http("/brand/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
element.title = element.name
let a = element
this.setData({
'selectItem[3].rank': this.data.selectItem[3].rank.concat(a)
})
});
})
http("/tag/list", "post", {}).then(res => {
// console.log(res.data.records)
res.data.records.forEach(element => {
element.is = false
let a = element
this.setData({
'selectItem[1].rank': this.data.selectItem[1].rank.concat(a)
})
});
})
},
// 点击菜单栏触发的事件函数
handleClick: function (e) {

@ -1,11 +1,12 @@
// pages/quest/subpage/detail/components/collection/collection.js
import {http} from '../../../../../../utils/util'
import {
http
} from '../../../../../../utils/util'
Component({
/**
* 组件的属性列表
*/
properties: {
},
properties: {},
/**
* 组件的初始数据
@ -45,8 +46,7 @@ Component({
brand: true
})
http("/brand/list", "post", ).then(res => {
if (this.data.brandpage === this.data.brandmax) {
} else {
if (this.data.brandpage === this.data.brandmax) {} else {
this.setData({
brands: this.data.brands.concat(res.data.records),
brandmax: res.data.pages,
@ -63,7 +63,8 @@ Component({
})
},
update() {
console.log(this.data.form)
// console.log(this.data.form)
// console.log(this.data.form.tel.match(/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/))
if (!this.data.form.name) {
wx.showToast({
title: '请输入姓名',
@ -76,6 +77,12 @@ Component({
icon: 'none',
duration: 2000
})
} else if (!this.data.form.tel.match(/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 2000
})
} else if (this.data.form.add.length === 0) {
wx.showToast({
title: '请选择地区',
@ -95,6 +102,17 @@ Component({
icon: 'none',
duration: 2000
})
if (res.success) {
this.setData({
form: {
name: '',
tel: '',
add: [],
type: null,
tip: ''
}
})
}
})
}
}

@ -4,13 +4,13 @@
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/ic_xingming@2x.png"></image>
姓名<text style="color: red;">*</text>
</view>
<input class="placeholder" placeholder="输入姓名" bindinput="blur" data-mes="name"></input>
<input class="placeholder" placeholder="输入姓名" bindinput="blur" data-mes="name" value="{{form.name}}"></input>
<view class="hr"></view>
<view class="title">
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/ic_sjh@2x.png"></image>
手机号<text style="color: red;">*</text>
</view>
<input class="placeholder" placeholder="输入手机号" bindinput="blur" data-mes="tel"></input>
<input class="placeholder" placeholder="输入手机号" bindinput="blur" data-mes="tel" value="{{form.tel}}"></input>
<!-- <view class="placeholder">输入手机号 -->
<!-- </view> -->
<view class="hr"></view>
@ -39,7 +39,7 @@
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/ic_bz@2x.png"></image>
备注
</view>
<textarea class="placeholder" placeholder="输入备注信息" bindinput="blur" data-mes="tip" auto-height></textarea>
<textarea class="placeholder" placeholder="输入备注信息" bindinput="blur" data-mes="tip" auto-height value="{{form.tip}}"></textarea>
<!-- <view class="placeholder" style="height: 180rpx;">请输入备注信息 -->
<!-- </view> -->
</view>

@ -10,12 +10,12 @@
<view class="main_line"></view>
<view class="in">
<view class="he">起止时间</view>
<text class="mes">{{data.start}}\n~\n{{data.end}}</text>
<text class="mes">{{data.start}}~{{data.end}}</text>
</view>
<view class="in">
<view class="he">任务标签</view>
<view class="mes">
<view wx:for="{{data.tagList}}" wx:key="index">{{item.title}}\n
<view wx:for="{{data.tagList}}" wx:key="index">{{item.title}}<text wx:if="{{index<data.tagList.length-1}}">、</text>
</view>
</view>
</view>

@ -67,13 +67,15 @@
}
.mes {
max-width: 265rpx;
max-width: 400rpx;
font-size: 28rpx;
font-family: MiSans-Demibold, MiSans;
font-weight: 600;
color: #333333;
line-height: 28rpx;
text-align: end;
display: flex;
flex-wrap: wrap;
}
.in {

@ -19,7 +19,6 @@
}
.count_num {
width: 124rpx;
height: 64rpx;
font-size: 64rpx;
font-family: MiSans-Demibold, MiSans;

@ -1,5 +1,7 @@
// pages/quest/subpage/detail/components/link/link.js
import {http} from '../../../../../../utils/util'
import {
http
} from '../../../../../../utils/util'
Component({
/**
* 组件的属性列表
@ -74,6 +76,19 @@ Component({
})
},
up(e) {
if (!this.data.platform) {
wx.showToast({
title: '请选择平台',
icon: 'none',
duration: 2000
})
} else if (!this.data.link) {
wx.showToast({
title: '请输入链接',
icon: 'none',
duration: 2000
})
} else {
http("/video/userAdd", "post", {
id: this.data.data.id,
type: this.data.platform.id,
@ -85,8 +100,14 @@ Component({
duration: 2000
}).then(res => {
this.triggerEvent('getdata', '')
this.setData({
link_type: false,
platform: null,
link: ''
})
})
})
}
},
chooseImage() {
let that = this

@ -11,7 +11,7 @@
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/img_srlj@2x.png"></image>
输入链接
</view>
<textarea wx:if="{{!link_type}}" class="link" placeholder="输入链接" maxlength="500" bindinput="linkin" auto-height></textarea>
<textarea wx:if="{{!link_type}}" class="link" placeholder="输入链接" maxlength="500" bindinput="linkin" auto-height value="{{link}}"></textarea>
<!-- 上传图片 -->
<view class="title" wx:if="{{link_type}}">
<image style="width: 48rpx;height: 48rpx;margin-right: 16rpx;" src="../../image/img_srlj@2x.png"></image>

@ -44,8 +44,8 @@ Page({
table: res.data.rewardRuleList
})
this.setData({
'data.start': res.data.start.slice(0, 16),
'data.end': res.data.end.slice(0, 16)
'data.start': res.data.start.slice(0, 10),
'data.end': res.data.end.slice(0, 10)
})
})
http("/video/addedRecord", "post", {

@ -3,7 +3,7 @@
<view class="card">
<view class="top">
<view class="top_titel">
<image class="ico" src="/pages/quest/subpage/detail/image/short/img_douyin@2x.png"></image>
<image class="ico" src="/pages/quest/subpage/detail/image/img_douyin@2x.png"></image>
抖音
</view>
<view class="status">未提交</view>
@ -25,7 +25,7 @@
<view class="card">
<view class="top">
<view class="top_titel">
<image class="ico" src="/pages/quest/subpage/detail/image/short/img_kuaishou@2x.png"></image>
<image class="ico" src="/pages/quest/subpage/detail/image/img_kuaishou@2x.png"></image>
快手
</view>
<view class="status">未提交</view>
@ -47,7 +47,7 @@
<view class="card">
<view class="top">
<view class="top_titel">
<image class="ico" src="/pages/quest/subpage/detail/image/short/img_pyq@2x.png"></image>
<image class="ico" src="/pages/quest/subpage/detail/image/img_pyq@2x.png"></image>
朋友圈
</view>
<view class="status">未提交</view>
@ -69,7 +69,7 @@
<view class="card">
<view class="top">
<view class="top_titel">
<image class="ico" src="/pages/quest/subpage/detail/image/short/img_sph@2x.png"></image>
<image class="ico" src="/pages/quest/subpage/detail/image/img_sph@2x.png"></image>
视频号
</view>
<view class="status">未提交</view>

@ -80,11 +80,11 @@ Page({
key: 'token',
data: res.data.token
})
wx.getStorage({
key: 'token',
success (res) {
}
})
// wx.getStorage({
// key: 'token',
// success (res) {
// }
// })
}
})
}
@ -157,6 +157,19 @@ Page({
canIUseGetUserProfile: true
})
}
let that = this
wx.getStorage({
key: 'user',
success(res) {
// console.log('res')
// console.log(res)
that.setData({
user_avatar: res.data.avatar,
user_name: res.data.name,
user_tip: '欢迎来到星途~'
})
}
})
},
/**

@ -2,7 +2,7 @@
"projectname": "xx",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
"urlCheck": true
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"libVersion": "2.24.2",

@ -1,6 +1,7 @@
const host = 'https://api.sws010.com'
const host = 'https://api.sws010.com/wxApp'
const cdn = 'https://cdn.sws010.com'
// https://api.sws010.com/wxApp
// api.sws010.com
// cdn.sws010.com

@ -32,8 +32,8 @@ const http = (url, method, data, isLoading = true) => {
'token': wx.getStorageSync('token')
}
}
console.log(url)
console.log(method)
// console.log(url)
// console.log(method)
wx.request({
url: host + url,
method: 'POST',

Loading…
Cancel
Save