| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <uv-toast ref="toast"></uv-toast>
- <view class="">
- <navbar :title="$t('select_sex')" size="48" :backtext="$t('back')" color="#FFFFFF"></navbar>
- </view>
- <view class="app_content">
- <uv-toast ref="toast"></uv-toast>
- <view class='titlearea'>
- <text class='title_2'>{{$t('select_gender_for_valuating_people')}}</text>
- <text class='title_member'>{{$t('valuating_people')}}:{{selectuser.membername}}</text>
- <text class='title_desstr' decode='true'> {{$t('select_gender_text_1')}}</text>
- </view>
- <view>
- <uv-row justify="space-between" customStyle="margin-top: 6%">
- <uv-col span="6" align="center" @click="selectsex(1)">
- <uv-image class="img" src="/static/image/selecttype/man.png" mode="aspectFill"
- shape="circle" :lazy-load="true" width="150" height="150">
- </uv-image>
- <view class='mybtn' >{{$t('is_man')}}</view>
- </uv-col>
- <uv-col span="6" align="center" @click="selectsex(2)">
- <uv-image class="img" src="/static/image/selecttype/woman.png" mode="aspectFill"
- shape="circle" :lazy-load="true" width="150" height="150">
- </uv-image>
- <view class='mybtn' >{{$t('is_female')}}</view>
- </uv-col>
- </uv-row>
- </view>
- </view>
- </template>
- <script>
- import {tohome,tostemlistnext} from "/common/js/common.js"
- import {subanswerbyuserid} from "/common/api/scale.js"
- import {submembergenderwithuid} from "/common/api/fmember.js"
- export default{
- data(){
- return{
- userinfo:{},
- selectuser:{},
- scaleid:0,
- srid:0,
- scaleid:0,
- stemid:3,
- answertype: 1,
- }
- },
- methods: {
- init(){
- this.userinfo = uni.getStorageSync("userinfo")
- this.selectuser = uni.getStorageSync("selectuser")
- },
- selectsex(sex){
- let answervalue = false
- let answeroptionid = false
- switch(sex){
- case 1:
- answervalue=this.$t('man');
- answeroptionid=64
- break;
- case 2:
- answervalue=this.$t('female');
- answeroptionid=65
- break;
- default:
- return
- break;
- }
- let answer={
- userid:this.userinfo.id,
- fmemberid:this.selectuser.fmemberid,
- stemid:this.stemid,
- answertype:this.answertype,
- // answervalue:answervalue,
- // answeroptionid:answeroptionid,
- answeroption:answervalue,
- answeroptionid:answeroptionid
- }
- let data={
- userid:this.userinfo.id,
- fmemberid:this.selectuser.fmemberid,
- srid: this.srid,
- scaleid: this.scaleid,
- }
- subanswerbyuserid(answer,data).then(res=>{
- res = res.data
- if(0==res.code){
- this.$refs.toast.show({
- type: 'error',
- message: res.errmsg
- })
- return false
- }
- if(200==res.code){
- uni.setStorage({
- key: 'srid',
- data: res.resultData,
- });
- let data1 = {
- userid:this.userinfo.id,
- fmemberid:this.selectuser.fmemberid,
- gender:sex
- }
- submembergenderwithuid(data1)
- tostemlistnext(this.sindex,1)
- }
- })
- }
- },
- mounted() {
- uni.setNavigationBarTitle({
- title: this.$t('select_sex')
- });
- this.init()
- },
- onLoad: function (option) {
- this.scaleid=option.scaleid
- this.srid=option.srid
- this.sindex = option.sindex
- },
- onBackPress:function(option){
- tohome()
- return true
- },
- }
- </script>
- <style scoped>
- .titlearea{
- height:400rpx;
- display:flex;
- flex-direction:column;
- justify-content: center;
- align-items:center;
- }
- .title_2{
- margin-top:15rpx;
- font-size:36rpx;
- font-weight:400;
- color:#666666
- }
- .title_member{
- margin-top:30rpx;
- font-size:36rpx;
- font-weight:400;
- color:#648EB8;
- }
- .title_desstr{
- width:700rpx;
- margin-left:25rpx;
- margin-top:30rpx;
- font-size:36rpx;
- font-weight:400;
- color:#9C9C9C;
- }
- .mybtn{
- width:50%;
- font-size: 15px;
- }
- </style>
|