Commit d03c4c5d authored by Chenjiayou's avatar Chenjiayou

小票记录

parent 6f85e6ad
......@@ -6,35 +6,45 @@
<view class="formArea">
<u-form :model="form" ref="uForm" label-position="top">
<u-form-item label="姓名" >
<u-input v-model="form.nickName" />
<u-input v-model="form.name" />
</u-form-item>
<u-form-item label="性别" >
<u-input v-model="sex" :type="type" :border="border" @click="show = true" />
<u-select v-model="show" :list="list" @confirm="confirmSex"></u-select>
<u-input v-model="form.sex" :type="type" :border="border" @click="show = true" />
<u-select v-model="show" :list="list"></u-select>
</u-form-item>
<u-form-item label="生日" >
<u-input v-model="form.birthday" :type="type" :border="border" @click="birthshow = true" />
<u-picker mode="time" v-model="birthshow" :params="params" @confirm="confirmbirthday"></u-picker>
<u-picker mode="time" v-model="birthshow" :params="params"></u-picker>
</u-form-item>
<u-form-item label="您常驻地址" >
<u-input v-model="form.address" />
<u-form-item label="您的偏好" >
<u-checkbox-group @change="checkboxGroupChange" :wrap="true">
<u-checkbox
@change="checkboxChange"
v-model="form.preference"
v-for="(item, index) in preferenceList" :key="index"
:name="item.name"
>{{item.name}}</u-checkbox>
</u-checkbox-group>
</u-form-item>
<u-form-item label="您常驻地址(选填)" >
<u-input v-model="form.residentAddress" />
</u-form-item>
<u-form-item label="职业" >
<u-checkbox-group @change="checkboxGroupChange" :wrap="true">
<u-checkbox
@change="checkboxChange"
v-model="item.checked"
v-model="form.occupation"
v-for="(item, index) in occupationList" :key="index"
:name="item.name"
>{{item.name}}</u-checkbox>
</u-checkbox-group>
</u-form-item>
<u-form-item label="婚姻" >
<u-input v-model="marriage" :type="type" :border="border" @click="matrimonyshow = true" />
<u-select v-model="matrimonyshow" :list="matrimonyList" @confirm="confirmarriage"></u-select>
<u-form-item label="婚姻(选填)" >
<u-input v-model="form.matrimony" :type="type" :border="border" @click="matrimonyshow = true" />
<u-select v-model="matrimonyshow" :list="matrimonyList"></u-select>
</u-form-item>
<u-form-item label="身份证" >
<u-input v-model="form.idNumber" />
<u-form-item label="身份证(选填)" >
<u-input v-model="form.Identification" />
</u-form-item>
</u-form>
<view class="loginout">
......@@ -49,34 +59,176 @@
export default {
data(){
return{
marriage: '',
sex: '',
marriageVule: '',
matrimonyshow: false,
occupationList: [
{
id:1,
name: '视觉设计',
checked: false,
disabled: false
},
{
id:2,
name: '时尚造型',
checked: false,
disabled: false
},
{
id:3,
name: '影视传媒',
checked: false,
disabled: false
},
{
id:4,
name: '自媒体人',
checked: false,
disabled: false
},
{
name: '音乐工作者',
checked: false,
disabled: false
},
{
name: '文学工作者',
checked: false,
disabled: false
},
{
name: '艺术工作者',
checked: false,
disabled: false
},
{
name: '手作人',
checked: false,
disabled: false
},
{
name: 'Freelancer',
checked: false,
disabled: false
},
{
name: 'IF工作者',
checked: false,
disabled: false
},
{
name: '金融工作者',
checked: false,
disabled: false
},
{
name: '教育工作者',
checked: false,
disabled: false
},
{
name: '医疗健康人员',
checked: false,
disabled: false
},
{
name: '法律从业者',
checked: false,
disabled: false
},
{
name: '地产/建筑从事者',
checked: false,
disabled: false
},
{
name: '体育工作者',
checked: false,
disabled: false
},
{
name: '旅游业',
checked: false,
disabled: false
},
{
name: '高层管理者',
checked: false,
disabled: false
},
{
name: '运营生活服务行业',
checked: false,
disabled: false
},
{
name: '灵性职业',
checked: false,
disabled: false
},
{
name: '其他职业',
checked: false,
disabled: false
}
],
preferenceList:[
{
name: '精致女性',
checked: false,
disabled: false
},
{
name: '精致男性',
checked: false,
disabled: false
},
{
name: '本草纲目女孩',
checked: false,
disabled: false
},
{
name: '女性力量',
checked: false,
disabled: false
},
{
name: '爱宠一族',
checked: false,
disabled: false
},
{
name: '潮流时髦精',
checked: false,
disabled: false
},
{
name: '职业奋斗精',
checked: false,
disabled: false
},
{
name: '隐形富豪',
checked: false,
disabled: false
},
{
name: '当代想青年',
checked: false,
disabled: false
},
{
name: '美食饕客',
checked: false,
disabled: false
},
{
name: '电竞达人',
checked: false,
disabled: false
},
{
name: '亲子教育专家',
checked: false,
disabled: false
}
],
birthshow: false,
......@@ -93,13 +245,13 @@
border: false,
list:[
{
value: 'male',
value: '0',
label: '男'
}
,
{
value: 'female',
value: '1',
label: '女'
}
],
......@@ -127,127 +279,20 @@
}
}
},
onShow(){
this.getOccupationList()
setTimeout(() => {
this.getPeopleInfo()
},1000)
},
methods:{
getOccupationList(){
const dictName = 'occupation'
this.$u.get('/moblie/dict/getDicts/'+ dictName).then(res=>{
let List = res
for(const index in List) {
const item = List[index]
item.checked = false
item.disabled = false
}
console.log('list',List)
this.occupationList = List
})
},
confirmbirthday(e){
console.log('e',e)
this.form.birthday = e.year+'-'+e.month+ '-' + e.day
},
loginout(){
console.log('form',this.form)
let jobList =[]
this.occupationList.forEach(item => {
if(item.checked) {
jobList.push(item.id)
}
})
console.log('jobList',jobList)
let jobs = ''
if(jobList.length>0) {
jobs = jobList.join(',')
} else {
jobs = ''
}
this.$u.post('/user/update',{
id: this.form.id,
nickName: this.form.nickName,
gender:this.form.gender,
birthdayString: this.form.birthday,
address: this.form.address,
marriage: this.marriageVule,
idNumber: this.form.idNumber,
jobs: jobs
}).then(res => {
console.log('res',res)
uni.showToast({
title: '完善个人信息成功',
icon: 'success'
})
uni.navigateTo({
url: '/pages/user/profile'
})
})
},
confirmSex(e){
console.log('ee',e)
this.sex = e[0].label
this.form.gender = e[0].value
},
getPeopleInfo(){
this.$u.get('user/getInfo').then(res => {
console.log('个人信息',res)
if(res.gender === "male") {
this.sex = '男'
} else if(res.gender === "female"){
this.sex = '女'
}
if(res.jobs !== null) {
let JobList = []
JobList = res.jobs.split(",")
this.occupationList.forEach(item => {
JobList.forEach(Litem => {
if(item.id.toString() === Litem) {
item.checked = true
}
})
})
}
if(res.marriage !== null) {
if(res.marriage === '0') {
this.marriage = '未婚'
} else {
this.marriage = '已婚'
}
}
if(res.birthday !== null) {
res.birthday = res.birthday.slice(0,10)
}
this.form = res
})
},
confirm(e){
console.log('eeeee',e)
},
confirmarriage(e){
console.log('e',e)
this.marriage = e[0].label
this.marriageVule = e[0].value
},
// 选中某个复选框时,由checkbox时触发
checkboxChange(e) {
console.log(e);
// this.occupationList.forEach(item => {
// if(item.name === e.name) {
// item.checked = true
// } else {
// item.checked = false
// }
// })
//console.log(e);
},
// 选中任一checkbox时,由checkbox-group触发
checkboxGroupChange(e) {
// console.log(e);
},
loginout(){
}
}
}
......@@ -260,7 +305,7 @@
/deep/ .u-input{
width: 98%;
}
.content{
.content{
margin-left: 3%;
width: 94%;
background-color: #fff;
......
......@@ -22,6 +22,11 @@
"navigationBarTitleText": "活动"
}
}, {
"path": "pages/activity/activitydetail",
"style": {
"navigationBarTitleText": "活动详情"
}
},{
"path": "pages/shop/search",
"style": {
"navigationStyle": "custom", // 隐藏系统导航栏
......@@ -186,6 +191,15 @@
}
}
// ,{
// "path" : "pages/activity/activitydetail/activitydetail",
// "style" :
// {
// "navigationBarTitleText": "",
// "enablePullDownRefresh": false
// }
// }
],
"subPackages": [
{
......
<template>
<view>
<!-- 页面标题 -->
<view>
<view class="page-title" v-if="activitydetail.name">{{activitydetail.name}}</view>
<view class="page-title" v-else>---</view>
<u-line color="#b7b7b7" length="100%" hair-line="true"/>
</view>
<!-- 动态显示时间功能 -->
<view class="time-container">
<view class="timetext" v-if="activitydetail.activityBeginDate">{{activitydetail.activityBeginDate}}</view>
<view class="timetext" v-else>---</view>
</view>
<!-- 页面内容 -->
<view class="content">
<view v-if="activitydetail.activityDetails" v-html="activitydetail.activityDetails"></view>
<!-- 内容区域 -->
</view>
<!-- 底部固定按钮 -->
<view class="fixed-layer">
<view class="button-container">
<u-button class="bottom-button" shape="circle">
报名
</u-button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id:'',
activitydetail:'',
nmae:'',
activityBeginDate:'',
activityDetails:''
};
},
onLoad(options) {
console.log('options',options)
// if (options != null) {
// this.id = options.id
// }
// console.log("传参的id", this.id)
this.activitydetail=JSON.parse(decodeURIComponent(options.id))
this.activitydetail.activityDetails = this.activitydetail.activityDetails.replace('dev-api',
'https://qf.91isoft.com/cshop')
console.log("this.activitydetail", this.activitydetail)
this.activitydetail.activityDetails = this.activitydetail.activityDetails.replace(/\<img/gi,
'<img style="max-width:100%;height:auto;border-radius: 12px 12px 12px 12px;" ')
},
methods: {
},
}
</script>
<style lang="scss" scoped>
/deep/ .u-btn--default{
background-color: #fd0000 !important;
}
/deep/ .u-btn--default{
color:white !important;
}
.page-title {
margin: 10rpx 20rpx;
font-size:20px;
}
.time-container {
display: flex;
justify-content: flex-start;
padding: 20rpx;
}
.time {
font-size: 30px;
color: #555;
}
.content {
font-size: 18px;
margin: 10rpx 20rpx;
/* 内容样式 */
}
.fixed-layer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: white;
}
.button-container {
display: flex;
justify-content: center;
margin-bottom: 30rpx;
}
.bottom-button {
width: 80%;
color: white;
}
</style>
\ No newline at end of file
......@@ -15,26 +15,27 @@
<view :class="[buttonstatus==3? 'clickbutton' : 'onemonth']" @click="queryOnemonth">近一个月</view>
</view>
</view>
<view class="activity-list" v-for="item in 5" @click="gotodetail(item)">
<view class="activity-list" v-for="item in activityList" @click="gotodetail(item)">
<view class="leftlist">
<!-- <image :src="baseURL+item.imgUrl" class="leftlistimage"> -->
<image src="../../static/img/logo.jpg" class="leftlistimage">
<image :src="item.img" class="leftlistimage"></image>
<!-- <image src="../../static/img/logo.jpg" class="leftlistimage"/> -->
</view>
<view class="rightlist">
<view class="rightlist-title">活动名称</view>
<view class="rightlist-title">{{item.name}}</view>
<!-- <view class="rightlist-message">活动内容活动内容活动内容活动内容活动内容活动内容</view> -->
<view class="rightlist-time">
<view class="timeicon">
<u-icon name="clock" color="#666666;" size="28"></u-icon>
</view>
<view class="timetext">2023-06-30</view>
<view class="timetext" v-if="item.createTime">{{item.createTime}}</view>
<view class="timetext" v-else>-</view>
</view>
<view class="rightlist-address">
<view class="addressicon">
<u-icon name="map" color="#D84848;" size="28"></u-icon>
</view>
<view class="addresstext" >天津市</view>
<!-- <view class="addresstext" v-else>-</view> -->
<view class="addresstext" v-if="item.address">{{item.address}}</view>
<view class="addresstext" v-else>-</view>
</view>
</view>
</view>
......@@ -48,7 +49,7 @@
// } from "../api.js"
// import {
// activitylist
// } from "../../api/activity/index.js"
// } from "activity/index.js"
export default {
data() {
return {
......@@ -62,34 +63,51 @@
activityList: [], // 活动列表
queryParams: {
orderBy: 0,
status: 1
status: 1,
name: ''
},
buttonstatus: 1
buttonstatus: 1,
businessMessage: {}
}
},
onLoad() {
this.GetStatusBarHeight()
// this.GetStatusBarHeight()
this.getList()
},
onShow() {
this.getBanner()
this.getList()
// this.getBanner()
},
methods: {
// 获取自定义导航栏的高度
GetStatusBarHeight() {
let that = this;
wx.getSystemInfo({
success: function(res) {
that.StatusBarHeight = res.statusBarHeight + 58; //这就是状态栏的高度
console.log("that.StatusBarHeight", that.StatusBarHeight)
},
});
// GetStatusBarHeight() {
// let that = this;
// wx.getSystemInfo({
// success: function(res) {
// that.StatusBarHeight = res.statusBarHeight + 58; //这就是状态栏的高度
// console.log("that.StatusBarHeight", that.StatusBarHeight)
// },
// });
// },
getActivityList() {
const baseApi = this.baseApi;
this.$u.get('activity/list?tenantId='+this.businessMessage.id + '&orderBy='+this.queryParams.orderBy+'&name='+this.queryParams.name).then(res=>{
console.log("aaa",res)
this.activityList = res.records
let list = res.records;
for (const index in list) {
const item = list[index]
item.img = baseApi + '/file/getImgStream?idFile=' + item.img
}
})
},
// 跳转详情页
gotodetail(val) {
const type = 0
const data = JSON.stringify(val)
uni.navigateTo({
url: '/pages/activity/activitydetail' + '?id=' + val.businessId + '&type=' + type
url: '/pages/activity/activitydetail' + '?id=' + encodeURIComponent(data) + '&type=' + type
})
},
// 获取Banner图数据
......@@ -105,28 +123,37 @@
// },
// 获取活动列表
getList() {
activitylist(this.queryParams).then(response => {
console.log('活动列表', response)
this.activityList = response.rows
const that = this
uni.getStorage({
key:'business',
success:function(res){
that.businessMessage = res.data
console.log("商圈数据",that.businessMessage)
that.getActivityList()
}
})
// activitylist(this.queryParams).then(response => {
// console.log('活动列表', response)
// this.activityList = response.rows
// })
},
// 查询全部活动
queryAll() {
this.buttonstatus = 1
this.queryParams.orderBy = 0
this.getList()
this.getActivityList()
},
// 查询最新活动
queryNew() {
this.buttonstatus = 2
this.queryParams.orderBy = 1
this.getList()
this.getActivityList()
},
// 查询进一个月活动
queryOnemonth() {
this.buttonstatus = 3
this.queryParams.orderBy = 2
this.getList()
this.getActivityList()
}
}
}
......@@ -149,7 +176,7 @@
margin-top: 54rpx;
.select-title {
font-size: 19px;
font-size: 38rpx;
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
font-weight: bold;
color: #4F71CA;
......@@ -160,16 +187,16 @@
// height: 28px;
padding: 16rpx 34rpx;
background: #D84848;
border-radius: 14px 14px 14px 14px;
border-radius: 28rpx 28rpx 28rpx 28rpx;
display: flex;
margin-left: 22rpx;
justify-content: center;
align-items: center;
font-size: 13px;
font-size: 26rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #fff;
line-height: 13px;
line-height: 26rpx;
}
.select-button {
......@@ -186,11 +213,11 @@
display: flex;
justify-content: center;
align-items: center;
font-size: 13px;
font-size: 26rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #222222;
line-height: 13px;
line-height: 26rpx;
}
.nearbutton {
......@@ -201,11 +228,11 @@
display: flex;
justify-content: center;
align-items: center;
font-size: 13px;
font-size: 26rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #222222;
line-height: 13px;
line-height: 26rpx;
}
.onemonth {
......@@ -216,11 +243,11 @@
display: flex;
justify-content: center;
align-items: center;
font-size: 13px;
font-size: 26rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #222222;
line-height: 13px;
line-height: 26rpx;
}
}
}
......@@ -229,7 +256,7 @@
display: flex;
margin: 30rpx 34rpx 0 42rpx;
align-items: center;
border-bottom: 1px solid #F1F1F1;
border-bottom: 2rpx solid #F1F1F1;
.leftlist {
margin-right: 26rpx;
......@@ -243,7 +270,7 @@
.rightlist {
.rightlist-title {
font-size: 16px;
font-size: 32rpx;
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500;
color: #222222;
......@@ -251,7 +278,7 @@
}
.rightlist-message {
font-size: 14px;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #666666;
......@@ -272,7 +299,7 @@
}
.timetext {
font-size: 14px;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #666666;
......@@ -290,7 +317,7 @@
}
.addresstext {
font-size: 14px;
font-size: 28rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #DF6969;
......@@ -305,7 +332,7 @@
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-size: 26rpx;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #B9B9B9;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment