Browse Source

增加文化数据经纪商和交易主体内容

master
liaoxinyu 2 years ago
parent
commit
a269761fd7
  1. 1
      config.js
  2. 80
      node_modules/js-md5/package.json
  3. 16
      package-lock.json
  4. 30
      pages.json
  5. 562
      pages/category/economybusiness/list.vue
  6. 60
      pages/category/index.vue
  7. 471
      pages/category/tradingentity/detail.vue
  8. 562
      pages/category/tradingentity/list.vue
  9. 34
      utils/json/Informationlist.json
  10. 3576
      utils/json/temp.json
  11. 5
      utils/json/transaction.json

1
config.js

@ -13,6 +13,7 @@ module.exports = {
// apiUrl: "http://10.24.4.14:80/",
// apiUrl: "http://10.24.4.156/",
apiUrl: "./kk/",
// apiUrl: "http://192.168.66.219:8081/kk/",
/**
* 是否启用商城设置缓存

80
node_modules/js-md5/package.json

@ -1,8 +1,45 @@
{
"name": "js-md5",
"version": "0.8.3",
"_args": [
[
"js-md5@0.8.3",
"D:\\项目文件\\44\\why_in_h5"
]
],
"_development": true,
"_from": "js-md5@0.8.3",
"_id": "js-md5@0.8.3",
"_inBundle": false,
"_integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==",
"_location": "/js-md5",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "js-md5@0.8.3",
"name": "js-md5",
"escapedName": "js-md5",
"rawSpec": "0.8.3",
"saveSpec": null,
"fetchSpec": "0.8.3"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz",
"_spec": "0.8.3",
"_where": "D:\\项目文件\\44\\why_in_h5",
"author": {
"name": "Chen, Yi-Cyuan",
"email": "emn178@gmail.com"
},
"browser": {
"crypto": false,
"buffer": false
},
"bugs": {
"url": "https://github.com/emn178/js-md5/issues"
},
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
"main": "src/md5.js",
"devDependencies": {
"expect.js": "~0.3.1",
"jsdoc": "~4.0.2",
@ -12,18 +49,7 @@
"tiny-worker": "^2.3.0",
"uglify-js": "^3.1.9"
},
"scripts": {
"test": "nyc mocha tests/node-test.js",
"report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"doc": "rm -rf doc;jsdoc src README.md -d doc",
"compress": "uglifyjs src/md5.js -c -m eval --comments --output build/md5.min.js",
"build": "npm run-script compress;npm run-script doc"
},
"repository": {
"type": "git",
"url": "https://github.com/emn178/js-md5.git"
},
"homepage": "https://github.com/emn178/js-md5",
"keywords": [
"md5",
"hash",
@ -32,18 +58,24 @@
"HMAC"
],
"license": "MIT",
"author": "Chen, Yi-Cyuan <emn178@gmail.com>",
"homepage": "https://github.com/emn178/js-md5",
"bugs": {
"url": "https://github.com/emn178/js-md5/issues"
},
"main": "src/md5.js",
"name": "js-md5",
"nyc": {
"exclude": [
"tests"
]
},
"browser": {
"crypto": false,
"buffer": false
}
"repository": {
"type": "git",
"url": "git+https://github.com/emn178/js-md5.git"
},
"scripts": {
"build": "npm run-script compress;npm run-script doc",
"compress": "uglifyjs src/md5.js -c -m eval --comments --output build/md5.min.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"doc": "rm -rf doc;jsdoc src README.md -d doc",
"report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
"test": "nyc mocha tests/node-test.js"
},
"version": "0.8.3"
}

16
package-lock.json

@ -1,20 +1,6 @@
{
"name": "why_in_h5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"devDependencies": {
"js-md5": "^0.8.3"
}
},
"node_modules/js-md5": {
"version": "0.8.3",
"resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz",
"integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ==",
"dev": true
}
},
"lockfileVersion": 1,
"dependencies": {
"js-md5": {
"version": "0.8.3",

30
pages.json

@ -416,6 +416,36 @@
"navigationBarBackgroundColor": "#1c223b",
"enablePullDownRefresh": true
}
},
{
"path" : "pages/category/tradingentity/list",
"style" :
{
"navigationBarTitleText" : "交易主体",
"navigationBarBackgroundColor": "#1c223b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/category/tradingentity/detail",
"style" :
{
"navigationBarTitleText" : "更多标的",
"navigationBarBackgroundColor": "#1c223b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/category/economybusiness/list",
"style" :
{
"navigationBarTitleText" : "文化数据经济商",
"navigationBarBackgroundColor": "#1c223b",
"navigationBarTextStyle": "white",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {

562
pages/category/economybusiness/list.vue

@ -0,0 +1,562 @@
<template>
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<!-- 页面头部 -->
<!-- 搜索 -->
<view class="search">
<view class="search-wrapper">
<view class="index-search">
<view class="index-cont-search t-c">
<text class="search-icon iconfont icon-search"></text>
<text class="search-text">
<input type="text" placeholder="请输入关键字" v-model="searchValue">
</text>
<button class="search-text-bu" @click="onSearch">搜索</button>
</view>
</view>
</view>
</view>
<!-- 基本信息 -->
<view class="dis-flex">
<!-- 图片 -->
<view class="goods-item_left">
<image class="image" :src="userList.doorHeadPhoto"></image>
</view>
<view class="goods-item_right">
<!-- 名称 -->
<view class="goods-name">
<text class="twoline-hide">{{ userList.name }}</text>
</view>
<view class="goods-auth-type">
<text class="twoline-hide">{{ userList.authType }}</text>
</view>
<view class="goods-auth-num">
<text class="twoline-hide">标的数量{{ total }}</text>
</view>
</view>
</view>
<!-- 店铺信息 -->
<view class="dis-flex-info">
<view class="vertical-line"></view>
<view class="dis-flex-title">店铺信息</view>
<view class="dis-flex-line"></view>
<view class="dis-flex-content">
<text>卖方/授权方名称{{userList.name}}</text>
<text>认证类型{{userList.userType}}</text>
<text>认证状态{{userList.stateStr}}</text>
<text>交易主体标志码{{userList.user_islicode}}</text>
</view>
</view>
<!--排序-->
<view class="order">
<view v-for="items in tabText" class="tab_text" :class="{tab_link : items.value === targetTab}"
@click="changeTab(items.value)">{{ items.title }}
</view>
</view>
<!-- 标的列表 -->
<view class="goods-list clearfix">
<view class="goods-item" v-for="(item, index) in list.data" :key="index" @click="onTargetDetail(item.goods_islicode)">
<!-- 多列显示 -->
<view class="goods-item_left">
<!-- 图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.gdimg"></image>
</view>
<view class="detail">
<!-- 标题 -->
<view class="goods-name">
<text class="twoline-hide">{{ item.goods_name }}</text>
</view>
<!-- 价格 -->
<view class="detail-price oneline-hide">
<text class="goods-price f-30 col-m">{{ item.price }}</text>
<text class="goods-sales">销量{{item.sale_count}}</text>
</view>
<!-- 标的所有者的信息 -->
<view class="detail-owner oneline-hide">
<text class="oneline-hide"> {{ item.username }}</text>
</view>
</view>
</view>
</view>
</view>
</mescroll-body>
</template>
<script>
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
import * as GoodsApi from '@/api/goods'
import { getEmptyPaginateObj, getMoreListData } from '@/core/app'
//
import pako from '@/core/pako'
import { base64ToUint8Array,numberWithCommas} from '@/utils/util'
const pageSize = 8
export default {
components: {
MescrollBody,
},
mixins: [MescrollMixin],
data() {
return {
searchValue: '',
options: {}, //
list: getEmptyPaginateObj(), //
userList: {},
//
upOption: {
//
auto: true,
// ; 10
page: { size: pageSize },
// 4
noMoreSize: 4,
},
tabText: [
{
title: '上新排序',
value: 1
},
{
title: '销量排序',
value: 2
},
{
title: '价格排序',
value: 3
},
{
title: '更多',
value: 4
},
],
targetTab: 1,
total: 0,
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// options
this.options = options
},
methods: {
//
async onSearch() {
if (this.searchValue == '') {
this.$error('请输入搜索关键词');
} else {
await this.getGoodsList()
await this.getHomeListImage()
}
},
// tab
async changeTab(val) {
if (val == 4) {
let name = this.options.name
this.$navTo('pages/category/tradingentity/detail',{name})
} else {
this.targetTab = val
await this.getGoodsList()
await this.getHomeListImage()
}
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
* @param {Object} page
*/
async upCallback(page) {
const app = this
//
await app.getGoodsList(page.num)
.then(list => {
const curPageLen = list.data.length
const totalSize = list.data.total
app.mescroll.endBySize(curPageLen, totalSize)
})
.catch(() => app.mescroll.endErr())
//
await app.getHomeListImage()
},
/**
* 获取标的列表
* @param {number} pageNo 页码
*/
getGoodsList(pageNo = 1) {
const app = this
const param = {
authorization: '',
entrust_name: '',
entrust_user_name: app.options.name,
goods_status: '1',
limit: pageSize,
order: 'desc',
order_type: '',
page: pageNo,
record_type: '',
source_type: '',
is_user_data: '1',
}
if (app.searchValue != '') {
param.goods_name = app.searchValue
}
if (app.targetTab === 2) {
param.order_type = 'sale'
} else if (app.targetTab === 3) {
param.order_type = 'price'
}
return new Promise((resolve, reject) => {
GoodsApi.nbgoods(param)
.then(result => {
//
const newList = app.initList(result.data)
app.total = result.data.total
app.list.data = getMoreListData(newList, app.list, pageNo)
app.userList = newList.data[0].user
app.userList.stateStr = this.getUserStateStr(app.userList.state)
app.userList.user_islicode = newList.data[0].user_islicode
resolve(newList)
})
.catch(reject)
})
},
getUserStateStr(state){
let str = ''
if (state == "1" || state == "3" || state == "7" || state == "0") {
str = '认证中'
} else if (state == "2" || state == "4" || state == "5") {
str = '认证失败'
} else if (state == "6") {
str = '认证成功'
}
return str
},
//
initList(newList) {
newList.data.forEach(item => {
//
item.price = numberWithCommas(item.price)
item.gdimg = item.goods_image === "" ? '' : pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'})
})
return newList
},
async getHomeListImage() {
this.list.data.forEach((item, key) => {
if (item.goods_image === "") {
GoodsApi.nbgoodsImage({"id": item.id}).then(res2 => {
if (res2.code === 200) {
this.list.data[key].goods_image = res2.data.data[0].goods_image;
this.list.data[key].gdimg = pako.inflateRaw(base64ToUint8Array(res2.data.data[0].goods_image), {to: 'string'})
}
})
}
})
},
//
onTargetDetail(gislicode) {
this.$navTo('pages/goods/detail', { gislicode })
},
},
}
</script>
<style lang="scss" scoped>
//
.search {
position: fixed;
float: top;
top: var(--window-top);
left: var(--window-left);
right: var(--window-right);
z-index: 19;
.search-wrapper {
background: #1c223b;
padding: 0rpx 20rpx 20rpx 20rpx;
}
.index-search {
border-bottom: 0;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
font-size: 28rpx;
color: #6d6d6d;
box-sizing: border-box;
height: 64rpx;
line-height: 64rpx;
.index-cont-search {
width: 100%;
font-size: 28rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
.search-icon {
font-size: 34rpx;
margin-left: 50rpx;
}
.search-text {
text-align: left;
float: left;
font-size: 20rpx;
margin-left: 20rpx;
}
.search-text-bu {
margin-right: 20rpx;
color: #ffffff;
background-color: #1c223b;
font-size: 20rpx;
width: 120rpx;
height: 50rpx;
text-align: center;
border-radius: 50rpx;
}
}
}
}
//
.dis-flex {
display: flex;
width: 90%;
height: 240rpx;
margin: 100rpx 10rpx 20rpx 40rpx;
box-sizing: border-box;
background: #fff;
line-height: 1.6;
border-radius: 15rpx;
.goods-item_left {
display: flex;
width: 220rpx;
background: #fff;
align-items: center;
.image {
display: block;
width: 200rpx;
height: 200rpx;
}
}
.goods-item_right {
margin-top: 20rpx;
.goods-auth-type {
margin-top: 40rpx;
font-size: 26rpx;
color: #fbb154;
font-weight: bold;
}
.goods-auth-num {
margin-top: 40rpx;
font-size: 24rpx;
color: #d7d7d7;
}
}
}
//
.dis-flex-info {
position: relative;
width: 90%;
height: 300rpx;
background: #fff;
margin: 20rpx 40rpx;
border-radius: 10rpx;
color: #15192d;
.vertical-line {
position: absolute;
left: 0;
top: 0;
width: 12px;
height: 100%;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
background: linear-gradient(to bottom, #15192d, #15192d 50%); /* 渐变背景色 */
}
.dis-flex-title {
font-size: 30rpx;
margin-left: 40rpx;
padding-top: 20rpx;
padding-bottom: 10rpx;
}
.dis-flex-line {
border-bottom: 5rpx #15192d solid;
}
.dis-flex-content {
margin: 20rpx 40rpx;
white-space: normal;
text {
display: block;
margin-bottom: 10rpx;
font-size: 26rpx;
}
}
}
//
.order {
display: flex;
padding: 20rpx 10rpx 20rpx;
margin-left: -55rpx;
z-index: 65;
font-weight: bold;
.tab_text {
display: inline-block;
color: #1b223b;
font-size: 30rpx;
margin-left: 80rpx;
}
.tab_link {
border-bottom: 5rpx #1b223b solid;
}
}
//
.store-sort {
position: sticky;
top: var(--window-top);
display: flex;
padding: 20rpx 0;
font-size: 28rpx;
background: #fff;
color: #1b223b;
z-index: 99;
.sort-item {
flex-basis: 33.3333%;
display: flex;
justify-content: center;
align-items: center;
height: 50rpx;
&.active {
color: #e49a3d;
}
}
.sort-item-price .price-arrow {
margin-left: 20rpx;
font-size: 24rpx;
color: #000;
.icon {
&.active {
color: #e49a3d;
}
&.up {
margin-bottom: -16rpx;
}
&.down {
margin-top: -16rpx;
}
}
}
}
//
.goods-list {
padding: 4rpx;
box-sizing: border-box;
}
//
.goods-item {
float: left;
box-sizing: border-box;
padding: 6rpx;
width: 50%;
.goods-image {
position: relative;
width: 100%;
height: 0;
padding-bottom: 100%;
overflow: hidden;
background: #fff;
&:after {
content: '';
display: block;
margin-top: 100%;
}
.image {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
-o-object-fit: cover;
object-fit: cover;
}
}
.detail {
padding: 8rpx;
background: #fff;
.goods-name {
min-height: 68rpx;
line-height: 32rpx;
white-space: normal;
color: #484848;
font-size: 26rpx;
}
.detail-price {
.goods-price {
font-weight: bold;
margin-right: 8rpx;
}
.line-price {
text-decoration: line-through;
}
}
.goods-sales {
float: right;
color: #484848;
font-size: 20rpx;
margin-top: 10rpx;
}
.detail-owner{
padding: 4rpx;
font-size: 22rpx;
color: #999;
margin-left: 10rpx;
}
}
}
</style>

60
pages/category/index.vue

@ -67,9 +67,9 @@
<view v-else-if="serviceProvidersList.length>0 && type==3" class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
<view class="flex-two" v-for="(item, idx) in serviceProvidersList" :key="idx" @click="onTargetGoods(item.goods_islicode)">
<view class="cate-img-padding">
<view v-if="item.doorHeadPhoto" class="cate-img">
<view class="flex-three" v-for="(item, idx) in serviceProvidersList" :key="idx" @click="onEconomyBusiness(item.name)">
<view class="cate-img-padding1">
<view v-if="item.doorHeadPhoto" class="cate-img1">
<image class="image" mode="scaleToFill" :src="item.doorHeadPhoto"></image>
</view>
</view>
@ -81,7 +81,8 @@
<view v-else-if="transactionList.length>0 && type==4" class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
<view class="flex-three" v-for="(item, idx) in transactionList" :key="idx">
<view class="flex-three" v-for="(item, idx) in transactionList" :key="idx" @click="onTradingentity(item.name)">
<view class="cate-image"><image src="" mode=""></image></view>
<view class="cate-name">
{{item.name}}
</view>
@ -126,6 +127,8 @@
import pako from '@/core/pako'
import transaction from 'utils/json/transaction.json'
import temp from 'utils/json/temp.json'
import Informationlist from 'utils/json/Informationlist.json'
import {getMoreListData} from "../../api/category";
@ -174,7 +177,9 @@
menus,
type: 0,
informationList: [], // selected
// informationList: Informationlist.data, // selected
serviceProvidersList: [], //
// serviceProvidersList: temp.data, //
transactionList: transaction.data, //
userList: [], //
//
@ -316,6 +321,14 @@
onConsulting(consultingId){
this.$navTo('pages/category/consulting/list', { consultingId })
},
//
onTradingentity(name){
this.$navTo('pages/category/tradingentity/list', { name })
},
//
onEconomyBusiness(name){
this.$navTo('pages/category/economybusiness/list', { name })
},
//
async bindData(rd){
return new Promise((resolve, reject) => {
@ -447,6 +460,7 @@
.flex-three {
float: left;
width: 100%;
border-bottom: 1px solid #bbbbbb;
.cate-selected {
width: 100%;
@ -462,14 +476,25 @@
.cate-name {
width: 100%;
height: 200rpx;
height: 100rpx;
color: #000000;
background-color: #f7f7f7;
// background-color: #f7f7f7;
margin-top: 20rpx;
padding-top: 70rpx;
padding-top: 30rpx;
font-size: 28rpx;
text-align: center;
}
.cate-image{
// background-color: #1c223b;
width: 200rpx;
margin: auto;
margin-top: 20rpx;
image{
height: 200rpx;
width: 200rpx;
}
}
}
.cate-right {
@ -559,11 +584,16 @@
}
.cate-img-padding {
background-color: #f7f7f7;
// background-color: #f7f7f7;
margin-right: 20rpx;
padding: 16rpx 16rpx 4rpx 16rpx;
}
.cate-img-padding1{
height: 280rpx;
padding: 16rpx 16rpx 4rpx 16rpx;
}
.cate-img {
position: relative;
width: 100%;
@ -578,6 +608,20 @@
border-radius: 10rpx;
}
}
.cate-img1{
position: relative;
width: 100%;
padding-top: 70%;
.image {
width: 212rpx;
height: 240rpx;
position: absolute;
top: 0;
left: 25%;
border-radius: 10rpx;
}
}
.two-name {
width: 42%;

471
pages/category/tradingentity/detail.vue

@ -0,0 +1,471 @@
<template>
<view class="container">
<!-- 搜索 -->
<view class="search">
<view class="search-wrapper">
<view class="index-search">
<view class="index-cont-search t-c">
<text class="search-icon iconfont icon-search"></text>
<text class="search-text">
<input type="text" placeholder="请输入搜索关键字" v-model="searchValue">
</text>
<button class="search-text-bu" @click="onSearch">搜索</button>
</view>
</view>
</view>
</view>
<view class="order">
<view v-for="items in tabText" class="tab_text" :class="{tab_link : items.value === targetTab}"
@click="changeTab(items.value)">{{ items.title }}
</view>
</view>
<view class="glistzone">
<view class="diy-goods">
<view class="goods-list display__list column__2">
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }"
@down="downCallback" :up="upOption" @up="upCallback">
<view class="goods-item" v-for="(dataItem, index) in gdlist.data" :key="index"
@click="onTargetGoods(dataItem.goods_islicode)">
<!-- 多列商品 -->
<block>
<!-- 标的图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="dataItem.gdimg"></image>
</view>
<view class="detail">
<!-- 标的标题 -->
<view class="goods-name">
<text class="twoline-hide">{{ dataItem.goods_name }}</text>
</view>
<!-- 标的价格 && 销量-->
<view class="detail-price oneline-hide">
<text class="goods-price f-30 col-m"> {{ dataItem.price }}</text>
<text class="sale-count col-9 f-24">销量{{ dataItem.sale_count }}</text>
</view>
<!-- 标的所有者的信息 -->
<view class="detail-owner oneline-hide">
<text class="oneline-hide"> {{ dataItem.username }}</text>
</view>
</view>
</block>
</view>
</mescroll-body>
</view>
</view>
</view>
</view>
</template>
<script>
//
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
import {getEmptyPaginateObj, getMoreListData} from '@/core/app'
import { base64ToUint8Array,numberWithCommas } from '@/utils/util'
import * as Api from '@/api/page'
import * as Gapi from '@/api/goods'
import pako from '@/core/pako'
//
const pageSize = 10
export default {
components: {
MescrollBody, //
},
mixins: [MescrollMixin],
data() {
return {
searchValue: '',
tabText: [
{
title: '上新排序',
value: 1
},
{
title: '销量排序',
value: 2
},
{
title: '价格排序',
value: 3
},
],
targetTab: 1,
//
upOption: {
//
auto: true,
// ; 10
page: {size: pageSize},
// 4
noMoreSize: 4,
//
empty: {
tip: '暂无记录'
}
},
gdlist: getEmptyPaginateObj(),
};
},
methods: {
//
async onSearch() {
await this.getHomeList(1)
await this.getHomeListImage()
},
// tab
async changeTab(val) {
this.targetTab = val
await this.getHomeList(1)
await this.getHomeListImage()
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
* @param {Object} page
*/
async upCallback(page) {
const app = this
//
await app.getHomeList(page.num)
.then(list => {
const curPageLen = list.data.length
const totalSize = list.data.total
app.mescroll.endBySize(curPageLen, totalSize)
})
.catch(() => app.mescroll.endErr())
//
await app.getHomeListImage()
},
//
getHomeList(pageNo = 1) {
const app = this
//
let stimestamp = new Date().getTime()
// promise
return new Promise((resolve, reject) => {
let rqdata = {"pay_type": 2, "goods_status": 1, "page": pageNo, "limit": pageSize,"entrust_user_name": app.options.name}
// rqdata.record_type = 2
if (app.searchValue != '') {
rqdata.goods_name = app.searchValue
}
if (app.targetTab == 2) {
rqdata.order_type = 'sale'
} else if (app.targetTab == 3) {
rqdata.order_type = 'price'
rqdata.order = 'asc'
}
//
Gapi.nbgoods(rqdata)
.then(res => {
//
const newList = app.initList(res.data)
app.gdlist.data = getMoreListData(newList, app.gdlist, pageNo)
resolve(newList)
})
})
},
//
initList(newList) {
newList.data.forEach(item => {
//
item.price = numberWithCommas(item.price)
item.gdimg = item.goods_image === "" ? '' : pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'})
})
return newList
},
async getHomeListImage() {
this.gdlist.data.forEach((item, key) => {
if (item.goods_image === "") {
Gapi.nbgoodsImage({"id": item.id}).then(res2 => {
if (res2.code === 200) {
this.gdlist.data[key].goods_image = res2.data.data[0].goods_image;
this.gdlist.data[key].gdimg = pako.inflateRaw(base64ToUint8Array(res2.data.data[0].goods_image), {to: 'string'})
}
})
}
})
},
/**
* 跳转商品详情页
*/
onTargetGoods(gislicode) {
this.$navTo('pages/goods/detail', {gislicode})
},
}
}
</script>
<style lang="scss" scoped>
.container {
position: relative;
min-height: 100vh;
background-color: #efefef;
//
.search {
position: fixed;
float: top;
top: var(--window-top);
left: var(--window-left);
right: var(--window-right);
z-index: 19;
.search-wrapper {
background: #1c223b;
padding: 0rpx 20rpx 20rpx 20rpx;
}
.index-search {
border-bottom: 0;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
font-size: 28rpx;
color: #6d6d6d;
box-sizing: border-box;
height: 74rpx;
line-height: 74rpx;
.index-cont-search {
width: 100%;
font-size: 28rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
.search-icon {
font-size: 34rpx;
margin-left: 50rpx;
}
.search-text {
text-align: left;
float: left;
margin-left: 20rpx;
width: 100%;
input {
font-size: 20rpx;
}
}
.search-text-bu {
margin-right: 20rpx;
color: #ffffff;
background-color: #1c223b;
font-size: 20rpx;
width: 120rpx;
height: 50rpx;
text-align: center;
border-radius: 50rpx;
}
}
}
}
.order {
display: flex;
padding: 110rpx 10rpx 20rpx;
margin-left: -55rpx;
z-index: 65;
.tab_text {
display: inline-block;
color: #1b223b;
font-size: 30rpx;
margin-left: 80rpx;
}
.tab_link {
border-bottom: 1rpx #1b223b solid;
}
}
// goods
.glistzone{
padding: 4rpx;
}
.diy-goods {
.goods-list {
padding: 4rpx;
box-sizing: border-box;
margin-top: -20rpx;
.goods-item {
// background-color: #fff;
box-sizing: border-box;
padding: 16rpx;
.goods-image {
position: relative;
width: 100%;
height: 0;
padding-bottom: 100%;
overflow: hidden;
background: #fff;
&:after {
content: '';
display: block;
margin-top: 100%;
}
.image {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
-o-object-fit: cover;
object-fit: cover;
}
}
.detail {
padding: 8rpx;
background: #fff;
border-radius: 0 0 6% 6%;
box-shadow: #333 2rpx 3rpx 2rpx;
.goods-name {
min-height: 68rpx;
line-height: 1.3;
white-space: normal;
color: #484848;
font-size: 26rpx;
}
.detail-price {
.goods-price {
font-weight: 800;
margin-right: 8rpx;
}
.sale-count {
maring-left:20rpx;
font-size: 18rpx;
}
}
.detail-owner{
padding: 4rpx;
font-size: 22rpx;
color: #999;
margin-left: 10rpx;
}
}
}
&.display__slide {
white-space: nowrap;
font-size: 0;
.goods-item {
display: inline-block;
}
}
&.display__list {
.goods-item {
float: left;
}
}
&.column__2 {
.goods-item {
width: 50%;
}
}
&.column__3 {
.goods-item {
width: 33.33333%;
}
}
&.column__1 {
.goods-item {
width: 100%;
height: 280rpx;
margin-bottom: 12rpx;
padding: 20rpx;
box-sizing: border-box;
background: #fff;
line-height: 1.6;
&:last-child {
margin-bottom: 0;
}
}
.goods-item_left {
display: flex;
width: 40%;
background: #fff;
align-items: center;
.image {
display: block;
width: 240rpx;
height: 240rpx;
}
}
.goods-item_right {
position: relative;
width: 60%;
.goods-name {
margin-top: 20rpx;
min-height: 68rpx;
line-height: 1.3;
white-space: normal;
color: #484848;
font-size: 26rpx;
}
}
.goods-item_desc {
margin-top: 8rpx;
}
.desc-selling_point {
width: 400rpx;
font-size: 24rpx;
color: #e49a3d;
}
.desc-goods_sales {
color: #999;
font-size: 24rpx;
}
.desc_footer {
font-size: 24rpx;
.price_x {
margin-right: 16rpx;
color: #f03c3c;
font-size: 30rpx;
}
.price_y {
text-decoration: line-through;
}
}
}
}
}
}
</style>

562
pages/category/tradingentity/list.vue

@ -0,0 +1,562 @@
<template>
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<!-- 页面头部 -->
<!-- 搜索 -->
<view class="search">
<view class="search-wrapper">
<view class="index-search">
<view class="index-cont-search t-c">
<text class="search-icon iconfont icon-search"></text>
<text class="search-text">
<input type="text" placeholder="请输入关键字" v-model="searchValue">
</text>
<button class="search-text-bu" @click="onSearch">搜索</button>
</view>
</view>
</view>
</view>
<!-- 基本信息 -->
<view class="dis-flex">
<!-- 图片 -->
<view class="goods-item_left">
<image class="image" :src="userList.doorHeadPhoto"></image>
</view>
<view class="goods-item_right">
<!-- 名称 -->
<view class="goods-name">
<text class="twoline-hide">{{ userList.name }}</text>
</view>
<view class="goods-auth-type">
<text class="twoline-hide">{{ userList.authType }}</text>
</view>
<view class="goods-auth-num">
<text class="twoline-hide">标的数量{{ total }}</text>
</view>
</view>
</view>
<!-- 店铺信息 -->
<view class="dis-flex-info">
<view class="vertical-line"></view>
<view class="dis-flex-title">店铺信息</view>
<view class="dis-flex-line"></view>
<view class="dis-flex-content">
<text>卖方/授权方名称{{userList.name}}</text>
<text>认证类型{{userList.userType}}</text>
<text>认证状态{{userList.stateStr}}</text>
<text>交易主体标志码{{userList.user_islicode}}</text>
</view>
</view>
<!--排序-->
<view class="order">
<view v-for="items in tabText" class="tab_text" :class="{tab_link : items.value === targetTab}"
@click="changeTab(items.value)">{{ items.title }}
</view>
</view>
<!-- 标的列表 -->
<view class="goods-list clearfix">
<view class="goods-item" v-for="(item, index) in list.data" :key="index" @click="onTargetDetail(item.goods_islicode)">
<!-- 多列显示 -->
<view class="goods-item_left">
<!-- 图片 -->
<view class="goods-image">
<image class="image" mode="aspectFill" :src="item.gdimg"></image>
</view>
<view class="detail">
<!-- 标题 -->
<view class="goods-name">
<text class="twoline-hide">{{ item.goods_name }}</text>
</view>
<!-- 价格 -->
<view class="detail-price oneline-hide">
<text class="goods-price f-30 col-m">{{ item.price }}</text>
<text class="goods-sales">销量{{item.sale_count}}</text>
</view>
<!-- 标的所有者的信息 -->
<view class="detail-owner oneline-hide">
<text class="oneline-hide"> {{ item.username }}</text>
</view>
</view>
</view>
</view>
</view>
</mescroll-body>
</template>
<script>
import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
import * as GoodsApi from '@/api/goods'
import { getEmptyPaginateObj, getMoreListData } from '@/core/app'
//
import pako from '@/core/pako'
import { base64ToUint8Array,numberWithCommas} from '@/utils/util'
const pageSize = 8
export default {
components: {
MescrollBody,
},
mixins: [MescrollMixin],
data() {
return {
searchValue: '',
options: {}, //
list: getEmptyPaginateObj(), //
userList: {},
//
upOption: {
//
auto: true,
// ; 10
page: { size: pageSize },
// 4
noMoreSize: 4,
},
tabText: [
{
title: '上新排序',
value: 1
},
{
title: '销量排序',
value: 2
},
{
title: '价格排序',
value: 3
},
{
title: '更多',
value: 4
},
],
targetTab: 1,
total: 0,
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// options
this.options = options
},
methods: {
//
async onSearch() {
if (this.searchValue == '') {
this.$error('请输入搜索关键词');
} else {
await this.getGoodsList()
await this.getHomeListImage()
}
},
// tab
async changeTab(val) {
if (val == 4) {
let name = this.options.name
this.$navTo('pages/category/tradingentity/detail',{name})
} else {
this.targetTab = val
await this.getGoodsList()
await this.getHomeListImage()
}
},
/**
* 上拉加载的回调 (页面初始化时也会执行一次)
* 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10
* @param {Object} page
*/
async upCallback(page) {
const app = this
//
await app.getGoodsList(page.num)
.then(list => {
const curPageLen = list.data.length
const totalSize = list.data.total
app.mescroll.endBySize(curPageLen, totalSize)
})
.catch(() => app.mescroll.endErr())
//
await app.getHomeListImage()
},
/**
* 获取标的列表
* @param {number} pageNo 页码
*/
getGoodsList(pageNo = 1) {
const app = this
const param = {
authorization: '',
entrust_name: '',
entrust_user_name: app.options.name,
goods_status: '1',
limit: pageSize,
order: 'desc',
order_type: '',
page: pageNo,
record_type: '',
source_type: '',
is_user_data: '1',
}
if (app.searchValue != '') {
param.goods_name = app.searchValue
}
if (app.targetTab === 2) {
param.order_type = 'sale'
} else if (app.targetTab === 3) {
param.order_type = 'price'
}
return new Promise((resolve, reject) => {
GoodsApi.nbgoods(param)
.then(result => {
//
const newList = app.initList(result.data)
app.total = result.data.total
app.list.data = getMoreListData(newList, app.list, pageNo)
app.userList = newList.data[0].user
app.userList.stateStr = this.getUserStateStr(app.userList.state)
app.userList.user_islicode = newList.data[0].user_islicode
resolve(newList)
})
.catch(reject)
})
},
getUserStateStr(state){
let str = ''
if (state == "1" || state == "3" || state == "7" || state == "0") {
str = '认证中'
} else if (state == "2" || state == "4" || state == "5") {
str = '认证失败'
} else if (state == "6") {
str = '认证成功'
}
return str
},
//
initList(newList) {
newList.data.forEach(item => {
//
item.price = numberWithCommas(item.price)
item.gdimg = item.goods_image === "" ? '' : pako.inflateRaw(base64ToUint8Array(item.goods_image), {to: 'string'})
})
return newList
},
async getHomeListImage() {
this.list.data.forEach((item, key) => {
if (item.goods_image === "") {
GoodsApi.nbgoodsImage({"id": item.id}).then(res2 => {
if (res2.code === 200) {
this.list.data[key].goods_image = res2.data.data[0].goods_image;
this.list.data[key].gdimg = pako.inflateRaw(base64ToUint8Array(res2.data.data[0].goods_image), {to: 'string'})
}
})
}
})
},
//
onTargetDetail(gislicode) {
this.$navTo('pages/goods/detail', { gislicode })
},
},
}
</script>
<style lang="scss" scoped>
//
.search {
position: fixed;
float: top;
top: var(--window-top);
left: var(--window-left);
right: var(--window-right);
z-index: 19;
.search-wrapper {
background: #1c223b;
padding: 0rpx 20rpx 20rpx 20rpx;
}
.index-search {
border-bottom: 0;
background: #fff;
border-radius: 50rpx;
overflow: hidden;
font-size: 28rpx;
color: #6d6d6d;
box-sizing: border-box;
height: 64rpx;
line-height: 64rpx;
.index-cont-search {
width: 100%;
font-size: 28rpx;
background: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
.search-icon {
font-size: 34rpx;
margin-left: 50rpx;
}
.search-text {
text-align: left;
float: left;
font-size: 20rpx;
margin-left: 20rpx;
}
.search-text-bu {
margin-right: 20rpx;
color: #ffffff;
background-color: #1c223b;
font-size: 20rpx;
width: 120rpx;
height: 50rpx;
text-align: center;
border-radius: 50rpx;
}
}
}
}
//
.dis-flex {
display: flex;
width: 90%;
height: 240rpx;
margin: 100rpx 10rpx 20rpx 40rpx;
box-sizing: border-box;
background: #fff;
line-height: 1.6;
border-radius: 15rpx;
.goods-item_left {
display: flex;
width: 220rpx;
background: #fff;
align-items: center;
.image {
display: block;
width: 200rpx;
height: 200rpx;
}
}
.goods-item_right {
margin-top: 20rpx;
.goods-auth-type {
margin-top: 40rpx;
font-size: 26rpx;
color: #fbb154;
font-weight: bold;
}
.goods-auth-num {
margin-top: 40rpx;
font-size: 24rpx;
color: #d7d7d7;
}
}
}
//
.dis-flex-info {
position: relative;
width: 90%;
height: 300rpx;
background: #fff;
margin: 20rpx 40rpx;
border-radius: 10rpx;
color: #15192d;
.vertical-line {
position: absolute;
left: 0;
top: 0;
width: 12px;
height: 100%;
border-top-left-radius: 10rpx;
border-bottom-left-radius: 10rpx;
background: linear-gradient(to bottom, #15192d, #15192d 50%); /* 渐变背景色 */
}
.dis-flex-title {
font-size: 30rpx;
margin-left: 40rpx;
padding-top: 20rpx;
padding-bottom: 10rpx;
}
.dis-flex-line {
border-bottom: 5rpx #15192d solid;
}
.dis-flex-content {
margin: 20rpx 40rpx;
white-space: normal;
text {
display: block;
margin-bottom: 10rpx;
font-size: 26rpx;
}
}
}
//
.order {
display: flex;
padding: 20rpx 10rpx 20rpx;
margin-left: -55rpx;
z-index: 65;
font-weight: bold;
.tab_text {
display: inline-block;
color: #1b223b;
font-size: 30rpx;
margin-left: 80rpx;
}
.tab_link {
border-bottom: 5rpx #1b223b solid;
}
}
//
.store-sort {
position: sticky;
top: var(--window-top);
display: flex;
padding: 20rpx 0;
font-size: 28rpx;
background: #fff;
color: #1b223b;
z-index: 99;
.sort-item {
flex-basis: 33.3333%;
display: flex;
justify-content: center;
align-items: center;
height: 50rpx;
&.active {
color: #e49a3d;
}
}
.sort-item-price .price-arrow {
margin-left: 20rpx;
font-size: 24rpx;
color: #000;
.icon {
&.active {
color: #e49a3d;
}
&.up {
margin-bottom: -16rpx;
}
&.down {
margin-top: -16rpx;
}
}
}
}
//
.goods-list {
padding: 4rpx;
box-sizing: border-box;
}
//
.goods-item {
float: left;
box-sizing: border-box;
padding: 6rpx;
width: 50%;
.goods-image {
position: relative;
width: 100%;
height: 0;
padding-bottom: 100%;
overflow: hidden;
background: #fff;
&:after {
content: '';
display: block;
margin-top: 100%;
}
.image {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
-o-object-fit: cover;
object-fit: cover;
}
}
.detail {
padding: 8rpx;
background: #fff;
.goods-name {
min-height: 68rpx;
line-height: 32rpx;
white-space: normal;
color: #484848;
font-size: 26rpx;
}
.detail-price {
.goods-price {
font-weight: bold;
margin-right: 8rpx;
}
.line-price {
text-decoration: line-through;
}
}
.goods-sales {
float: right;
color: #484848;
font-size: 20rpx;
margin-top: 10rpx;
}
.detail-owner{
padding: 4rpx;
font-size: 22rpx;
color: #999;
margin-left: 10rpx;
}
}
}
</style>

34
utils/json/Informationlist.json

@ -0,0 +1,34 @@
{
"resultCode": "00000000",
"resultMsg": "SUCCESS",
"data": [
{
"consultingId": "762033233176170504",
"consultingName": "信息公开",
"consultingStatus": 0,
"consultingSort": 4,
"consultingCreationTime": "2022-08-30 16:49:06"
},
{
"consultingId": "762033263727480878",
"consultingName": "行业资讯",
"consultingStatus": 0,
"consultingSort": 3,
"consultingCreationTime": "2022-08-30 16:49:13"
},
{
"consultingId": "762033286561271818",
"consultingName": "最新活动",
"consultingStatus": 0,
"consultingSort": 2,
"consultingCreationTime": "2022-08-30 16:49:19"
},
{
"consultingId": "762033310561079327",
"consultingName": "专家观点",
"consultingStatus": 0,
"consultingSort": 1,
"consultingCreationTime": "2022-08-30 16:49:24"
}
]
}

3576
utils/json/temp.json

File diff suppressed because it is too large

5
utils/json/transaction.json

@ -77,6 +77,9 @@
},
{
"name": "深圳凯华技术有限公司"
}
},
{
"name": "深圳国夏文化数字科技有限公司"
}
]
}
Loading…
Cancel
Save