神码工具优化

2024-11-19 11:16:12 阅读:5 编辑

带支付功能

submitOrder(){
  app.api.apiOtherorderSetOrder(data).then((res) => {
    this.onThreePayJump(res.data.order_id, '&source=storeupgrade', 1);
  }).catch((err) => {
    app.tips(err);
  });
},

页面标签导航示例

<view class="nav">
  <view class="nav-li {{nav_curr==index?'active':''}}" wx:for="{{nav_arr}}" wx:key="index" catchtap="onNavTap" data-idx="{{index}}">
    <text class="nav-txt">{{item}}</text>
  </view>
</view>
.nav {
  width: 750rpx;
  height: 82rpx;
  background-color: #fff;
  display: flex;
}

.nav-li {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.nav-txt {
  color: #8e8e8e;
  font-size: 30rpx;
  line-height: 78rpx;
}

.nav-li.active .nav-txt {
  font-size: 32rpx;
  color: #000000;
}

.nav-li.active::after {
  content: '';
  width: 40rpx;
  height: 4rpx;
  background-color: #1d85ff;
  border-radius: 4rpx;
}
data:{
  nav_arr: ['标签一', '标签二', '标签三'],
  nav_curr: 0,
},
onNavTap(e) {
  let idx = e.currentTarget.dataset.idx;
  this.setData({
    nav_curr: idx,
  });
},

列表页面+接口循环列表,没有更多记录替换

原:

<view class="none">{{list.over && !list.none ? '没有更多记录啦!' : list.over && list.none ? '暂无记录!' : ''}}</view>

替换为:

<load-data over="{{list.over}}" none="{{list.none}}" domain_url_front2="{{domain_url_front2}}"></load-data>
  "usingComponents": {
    "load-data":"/common_components/loaddatawram/loaddatawram"
  },
  "componentPlaceholder": {
    "load-data": "view"
  }

部分组件无效:

需求

雏清:希望可以保存自己的常用代码,选择后添加到页面的末尾。