123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <template>
- <view class="page">
- <view class="mainBody">
- <view class="menu">
- <view class="item" :class="{'active':tab===1}" @click="checkTab(1)">
- <text class="left">全部</text>
- <view class="line"></view>
- </view>
- <view class="item" :class="{'active':tab===2}" @click="checkTab(2)">
- <text class="left">进行中</text>
- <view class="line"></view>
- </view>
- <view class="item" :class="{'active':tab===3}" @click="checkTab(3)">
- <text class="left">已完成</text>
- <view class="line"></view>
- </view>
- </view>
- </view>
- <view class="list_info">
- <block v-for="(item,index) in 10" :key="index">
- <view class="item">
- <view class="avator">
- <image class="icon" src="../../static/me/sex_2.png" mode="widthFix">
- </image>
- </view>
- <view class="tit">
- <view class="name">原淑功</view>
- </view>
- <view class="state">
- <view class="status_1">进行中</view>
- <view class="status_9">已完成</view>
- </view>
- </view>
- <view class="huifu">
- <view class="left">
- <view class="imgBg">
- <image class="icon" src="../../static/me/sex_2.png" mode="widthFix">
- </view>
- <view class="name">
- <text class="title">99架飞机</text>
- <text class="price">¥1000.00</text>
- </view>
- </view>
- <view class="right">x1</view>
- </view>
- <view class="desc">
- 赠送于2023-10-10 15:00
- </view>
- </block>
- <view class="blankHeight"></view>
- </view>
- </view>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- tab: 1,
- list: [{
- name: '实名认证',
- 'desc': '',
- 'path': ''
- },
- {
- name: '修改密码',
- 'desc': '',
- 'path': ''
- },
- {
- name: '修改手机号',
- 'desc': '',
- 'path': ''
- },
- {
- name: '注销账号',
- 'desc': '',
- 'path': ''
- },
- {
- name: '青少年模式',
- 'switch': 1,
- 'desc': '',
- 'path': ''
- },
- {
- name: '客服热线',
- 'desc': '400-888-1688',
- 'path': ''
- }
- ],
- stype: 'get'
- }
- },
- onLoad() {},
- onShow() {
- let that = this;
- // uni.setNavigationBarTitle({
- // titleNView: that.titleNView
- // });
- this.setStyle(1, '我收到的')
- // this.loadData();
- },
- onNavigationBarButtonTap(e) {
- if (e.index === 0) {
- // 执行代码块
- console.log("ee", e.index)
- if (this.stype == 'get') {
- this.stype = 'put';
- this.setStyle(1, '我打赏的');
- uni.setNavigationBarTitle({
- title: "我收到的"
- })
- } else {
- this.stype = 'get';
- this.setStyle(1, '我收到的');
- uni.setNavigationBarTitle({
- title: "我打赏的"
- })
- }
- }
- },
- methods: {
- setStyle(index, text) {
- let pages = getCurrentPages();
- let page = pages[pages.length - 1];
- // if (text.length > 3) {
- // text = text.substr(0, 3) + '...';
- // }
- // #ifdef APP-PLUS
- let currentWebview = page.$getAppWebview();
- let titleNView = currentWebview.getStyle().titleNView;
- // 添加文字过长截取为3个字符,请根据自己业务需求更改
- titleNView.buttons[0].text = text;
- currentWebview.setStyle({
- titleNView: titleNView
- });
- // #endif
- // #ifdef H5
- // h5 临时方案
- const btn = document.getElementsByClassName('uni-btn-icon')[index]
- btn.innerText = text;
- // #endif
- },
- onClickButton1() {
- console.log('点击了按钮1')
- },
- onClickButton2() {
- console.log('点击了按钮2')
- },
- onBack() {},
- checkTab(tab) {
- this.tab = tab;
- // this.loadData();
- },
- loadData() {
- console.log("this.globalData", getApp().globalData);
- let obj2 = {
- is_first: 0
- }
- const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
- console.log(postData);
- uni.request({
- url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
- data: postData,
- method: 'POST',
- header: {
- 'content-type': 'application/json', //自定义请求头信息
- 'Access-Control-Allow-Origin': '*'
- },
- success: (res) => {
- console.log('data:', res.data);
- this.myinfo = res.data;
- }
- });
- },
- EditNickname() {
- let that = this;
- this.$refs['DialogBox'].confirm({
- title: '更改昵称',
- placeholder: '请输入修改的昵称',
- value: that.myinfo.nickname,
- DialogType: 'input',
- animation: 0
- }).then((res) => {
- if (res.value.length < 1) {
- uni.showToast({
- title: "请输入有效的昵称",
- icon: 'none'
- });
- return;
- }
- that.myinfo.nickname = res.value;
- let obj2 = {
- nickname: res.value
- }
- const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
- uni.request({
- url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
- data: postData,
- method: 'POST',
- header: {
- 'content-type': 'application/json', //自定义请求头信息
- 'Access-Control-Allow-Origin': '*'
- },
- success: (res) => {
- uni.showToast({
- title: res.data.str,
- icon: 'none'
- });
- }
- });
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'dashang.scss';
- </style>
|