2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Effect picture, price from high to low descending
Price from low to high ascending
The js descending and ascending codes are as follows
- export default {
- data() {
- return {
- MtList:[]
- }
- },
- onLoad() {
- this.MtypeName();//加载列表方法
- },
- methods: {
- MtypeName(){//列表方法
- this.$api.getTypeNameUserID({
- ctime1:this.ctime3,
- ctime2:this.ctime4,
- }).then(res => {//allmoney 金额
- this.MtList = res.result.sort((a,b)=>b.allmoney-a.allmoney);//降序
- //this.MtList = res.result.sort((a,b)=>a.allmoney-b.allmoney);//升序
- })
- },
- }
wxml code
- <view class="typeClassDiv">
- <view class="typeListClass" v-for="(m,index) in MtList" @click="typeBut(m.typename,m.allmoney,m.bCount)">
- <image :src="m.typeLogo" class="tyLogo"></image>
- <view class="tyContent">
- <view class="tytop"><text class='typeNameClass'>{{m.typename}}</text><text class='typeMClass'>{{m.bfb}}%({{m.bCount}}笔)</text></view>
- <view class="tybottom">
- <view class="progress-box">
- <progress style="padding-top: 10px;padding-left: 2px;" :percent="m.bfb" stroke-width="3"/>
- </view>
- </view>
- </view>
- <view class="tyFont">
- ¥{{m.allmoney}}
- </view>
- </view>
- </view>
Mini Program Daily Notes Analysis Page can be referenced