作者 燕成杰

Merge branch 'master' of http://114.215.101.231:8099/yanchengjie/Bitcoin into yan

... ... @@ -27,11 +27,12 @@ export const product_favorite = (product_id) => request({url: 'product/product_
// 产品举报原因
export const report_list = (data) => request({url: 'product/report_list',method: 'post',data: data})
// 产品举报
export const product_report = (data) => request({url: 'product/product_report',method: 'post',data: data})
// 获取买家填写的信息
export const last_buy_data = (data) => request({url: 'product/last_buy_data',method: 'post',data: data})
// 产品举报
export const product_report = (data) => request({url: 'product/product_report',method: 'post',data: data})
// 实名认证
export const user_cert = (data) => request({url: 'user/user_cert',method: 'post',data: data})
... ...
# jweixin-module
微信JS-SDK
## 安装
### NPM
```shell
npm install jweixin-module --save
```
### UMD
```http
https://unpkg.com/jweixin-module/out/index.js
```
## 使用
```js
var jweixin = require('jweixin-module')
jweixin.ready(function(){
// TODO
});
```
## 完整API
>[微信JS-SDK说明文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)
... ...
!function(e,n){"function"==typeof define&&(define.amd||define.cmd)?define(function(){return n(e)}):n(e,!0)}(window,function(o,e){if(!o.jWeixin){var n,c={config:"preVerifyJSAPI",onMenuShareTimeline:"menu:share:timeline",onMenuShareAppMessage:"menu:share:appmessage",onMenuShareQQ:"menu:share:qq",onMenuShareWeibo:"menu:share:weiboApp",onMenuShareQZone:"menu:share:QZone",previewImage:"imagePreview",getLocation:"geoLocation",openProductSpecificView:"openProductViewWithPid",addCard:"batchAddCard",openCard:"batchViewCard",chooseWXPay:"getBrandWCPayRequest",openEnterpriseRedPacket:"getRecevieBizHongBaoRequest",startSearchBeacons:"startMonitoringBeacons",stopSearchBeacons:"stopMonitoringBeacons",onSearchBeacons:"onBeaconsInRange",consumeAndShareCard:"consumedShareCard",openAddress:"editAddress"},a=function(){var e={};for(var n in c)e[c[n]]=n;return e}(),i=o.document,t=i.title,r=navigator.userAgent.toLowerCase(),s=navigator.platform.toLowerCase(),d=!(!s.match("mac")&&!s.match("win")),u=-1!=r.indexOf("wxdebugger"),l=-1!=r.indexOf("micromessenger"),p=-1!=r.indexOf("android"),f=-1!=r.indexOf("iphone")||-1!=r.indexOf("ipad"),m=(n=r.match(/micromessenger\/(\d+\.\d+\.\d+)/)||r.match(/micromessenger\/(\d+\.\d+)/))?n[1]:"",g={initStartTime:L(),initEndTime:0,preVerifyStartTime:0,preVerifyEndTime:0},h={version:1,appId:"",initTime:0,preVerifyTime:0,networkType:"",isPreVerifyOk:1,systemType:f?1:p?2:-1,clientVersion:m,url:encodeURIComponent(location.href)},v={},S={_completes:[]},y={state:0,data:{}};O(function(){g.initEndTime=L()});var I=!1,_=[],w={config:function(e){B("config",v=e);var t=!1!==v.check;O(function(){if(t)M(c.config,{verifyJsApiList:C(v.jsApiList),verifyOpenTagList:C(v.openTagList)},function(){S._complete=function(e){g.preVerifyEndTime=L(),y.state=1,y.data=e},S.success=function(e){h.isPreVerifyOk=0},S.fail=function(e){S._fail?S._fail(e):y.state=-1};var t=S._completes;return t.push(function(){!function(){if(!(d||u||v.debug||m<"6.0.2"||h.systemType<0)){var i=new Image;h.appId=v.appId,h.initTime=g.initEndTime-g.initStartTime,h.preVerifyTime=g.preVerifyEndTime-g.preVerifyStartTime,w.getNetworkType({isInnerInvoke:!0,success:function(e){h.networkType=e.networkType;var n="https://open.weixin.qq.com/sdk/report?v="+h.version+"&o="+h.isPreVerifyOk+"&s="+h.systemType+"&c="+h.clientVersion+"&a="+h.appId+"&n="+h.networkType+"&i="+h.initTime+"&p="+h.preVerifyTime+"&u="+h.url;i.src=n}})}}()}),S.complete=function(e){for(var n=0,i=t.length;n<i;++n)t[n]();S._completes=[]},S}()),g.preVerifyStartTime=L();else{y.state=1;for(var e=S._completes,n=0,i=e.length;n<i;++n)e[n]();S._completes=[]}}),w.invoke||(w.invoke=function(e,n,i){o.WeixinJSBridge&&WeixinJSBridge.invoke(e,x(n),i)},w.on=function(e,n){o.WeixinJSBridge&&WeixinJSBridge.on(e,n)})},ready:function(e){0!=y.state?e():(S._completes.push(e),!l&&v.debug&&e())},error:function(e){m<"6.0.2"||(-1==y.state?e(y.data):S._fail=e)},checkJsApi:function(e){M("checkJsApi",{jsApiList:C(e.jsApiList)},(e._complete=function(e){if(p){var n=e.checkResult;n&&(e.checkResult=JSON.parse(n))}e=function(e){var n=e.checkResult;for(var i in n){var t=a[i];t&&(n[t]=n[i],delete n[i])}return e}(e)},e))},onMenuShareTimeline:function(e){P(c.onMenuShareTimeline,{complete:function(){M("shareTimeline",{title:e.title||t,desc:e.title||t,img_url:e.imgUrl||"",link:e.link||location.href,type:e.type||"link",data_url:e.dataUrl||""},e)}},e)},onMenuShareAppMessage:function(n){P(c.onMenuShareAppMessage,{complete:function(e){"favorite"===e.scene?M("sendAppMessage",{title:n.title||t,desc:n.desc||"",link:n.link||location.href,img_url:n.imgUrl||"",type:n.type||"link",data_url:n.dataUrl||""}):M("sendAppMessage",{title:n.title||t,desc:n.desc||"",link:n.link||location.href,img_url:n.imgUrl||"",type:n.type||"link",data_url:n.dataUrl||""},n)}},n)},onMenuShareQQ:function(e){P(c.onMenuShareQQ,{complete:function(){M("shareQQ",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareWeibo:function(e){P(c.onMenuShareWeibo,{complete:function(){M("shareWeiboApp",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},onMenuShareQZone:function(e){P(c.onMenuShareQZone,{complete:function(){M("shareQZone",{title:e.title||t,desc:e.desc||"",img_url:e.imgUrl||"",link:e.link||location.href},e)}},e)},updateTimelineShareData:function(e){M("updateTimelineShareData",{title:e.title,link:e.link,imgUrl:e.imgUrl},e)},updateAppMessageShareData:function(e){M("updateAppMessageShareData",{title:e.title,desc:e.desc,link:e.link,imgUrl:e.imgUrl},e)},startRecord:function(e){M("startRecord",{},e)},stopRecord:function(e){M("stopRecord",{},e)},onVoiceRecordEnd:function(e){P("onVoiceRecordEnd",e)},playVoice:function(e){M("playVoice",{localId:e.localId},e)},pauseVoice:function(e){M("pauseVoice",{localId:e.localId},e)},stopVoice:function(e){M("stopVoice",{localId:e.localId},e)},onVoicePlayEnd:function(e){P("onVoicePlayEnd",e)},uploadVoice:function(e){M("uploadVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadVoice:function(e){M("downloadVoice",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},translateVoice:function(e){M("translateVoice",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},chooseImage:function(e){M("chooseImage",{scene:"1|2",count:e.count||9,sizeType:e.sizeType||["original","compressed"],sourceType:e.sourceType||["album","camera"]},(e._complete=function(e){if(p){var n=e.localIds;try{n&&(e.localIds=JSON.parse(n))}catch(e){}}},e))},getLocation:function(e){},previewImage:function(e){M(c.previewImage,{current:e.current,urls:e.urls},e)},uploadImage:function(e){M("uploadImage",{localId:e.localId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},downloadImage:function(e){M("downloadImage",{serverId:e.serverId,isShowProgressTips:0==e.isShowProgressTips?0:1},e)},getLocalImgData:function(e){!1===I?(I=!0,M("getLocalImgData",{localId:e.localId},(e._complete=function(e){if(I=!1,0<_.length){var n=_.shift();wx.getLocalImgData(n)}},e))):_.push(e)},getNetworkType:function(e){M("getNetworkType",{},(e._complete=function(e){e=function(e){var n=e.errMsg;e.errMsg="getNetworkType:ok";var i=e.subtype;if(delete e.subtype,i)e.networkType=i;else{var t=n.indexOf(":"),o=n.substring(t+1);switch(o){case"wifi":case"edge":case"wwan":e.networkType=o;break;default:e.errMsg="getNetworkType:fail"}}return e}(e)},e))},openLocation:function(e){M("openLocation",{latitude:e.latitude,longitude:e.longitude,name:e.name||"",address:e.address||"",scale:e.scale||28,infoUrl:e.infoUrl||""},e)},getLocation:function(e){M(c.getLocation,{type:(e=e||{}).type||"wgs84"},(e._complete=function(e){delete e.type},e))},hideOptionMenu:function(e){M("hideOptionMenu",{},e)},showOptionMenu:function(e){M("showOptionMenu",{},e)},closeWindow:function(e){M("closeWindow",{},e=e||{})},hideMenuItems:function(e){M("hideMenuItems",{menuList:e.menuList},e)},showMenuItems:function(e){M("showMenuItems",{menuList:e.menuList},e)},hideAllNonBaseMenuItem:function(e){M("hideAllNonBaseMenuItem",{},e)},showAllNonBaseMenuItem:function(e){M("showAllNonBaseMenuItem",{},e)},scanQRCode:function(e){M("scanQRCode",{needResult:(e=e||{}).needResult||0,scanType:e.scanType||["qrCode","barCode"]},(e._complete=function(e){if(f){var n=e.resultStr;if(n){var i=JSON.parse(n);e.resultStr=i&&i.scan_code&&i.scan_code.scan_result}}},e))},openAddress:function(e){M(c.openAddress,{},(e._complete=function(e){e=function(e){return e.postalCode=e.addressPostalCode,delete e.addressPostalCode,e.provinceName=e.proviceFirstStageName,delete e.proviceFirstStageName,e.cityName=e.addressCitySecondStageName,delete e.addressCitySecondStageName,e.countryName=e.addressCountiesThirdStageName,delete e.addressCountiesThirdStageName,e.detailInfo=e.addressDetailInfo,delete e.addressDetailInfo,e}(e)},e))},openProductSpecificView:function(e){M(c.openProductSpecificView,{pid:e.productId,view_type:e.viewType||0,ext_info:e.extInfo},e)},addCard:function(e){for(var n=e.cardList,i=[],t=0,o=n.length;t<o;++t){var r=n[t],a={card_id:r.cardId,card_ext:r.cardExt};i.push(a)}M(c.addCard,{card_list:i},(e._complete=function(e){var n=e.card_list;if(n){for(var i=0,t=(n=JSON.parse(n)).length;i<t;++i){var o=n[i];o.cardId=o.card_id,o.cardExt=o.card_ext,o.isSuccess=!!o.is_succ,delete o.card_id,delete o.card_ext,delete o.is_succ}e.cardList=n,delete e.card_list}},e))},chooseCard:function(e){M("chooseCard",{app_id:v.appId,location_id:e.shopId||"",sign_type:e.signType||"SHA1",card_id:e.cardId||"",card_type:e.cardType||"",card_sign:e.cardSign,time_stamp:e.timestamp+"",nonce_str:e.nonceStr},(e._complete=function(e){e.cardList=e.choose_card_info,delete e.choose_card_info},e))},openCard:function(e){for(var n=e.cardList,i=[],t=0,o=n.length;t<o;++t){var r=n[t],a={card_id:r.cardId,code:r.code};i.push(a)}M(c.openCard,{card_list:i},e)},consumeAndShareCard:function(e){M(c.consumeAndShareCard,{consumedCardId:e.cardId,consumedCode:e.code},e)},chooseWXPay:function(e){M(c.chooseWXPay,V(e),e)},openEnterpriseRedPacket:function(e){M(c.openEnterpriseRedPacket,V(e),e)},startSearchBeacons:function(e){M(c.startSearchBeacons,{ticket:e.ticket},e)},stopSearchBeacons:function(e){M(c.stopSearchBeacons,{},e)},onSearchBeacons:function(e){P(c.onSearchBeacons,e)},openEnterpriseChat:function(e){M("openEnterpriseChat",{useridlist:e.userIds,chatname:e.groupName},e)},launchMiniProgram:function(e){M("launchMiniProgram",{targetAppId:e.targetAppId,path:function(e){if("string"==typeof e&&0<e.length){var n=e.split("?")[0],i=e.split("?")[1];return n+=".html",void 0!==i?n+"?"+i:n}}(e.path),envVersion:e.envVersion},e)},openBusinessView:function(e){M("openBusinessView",{businessType:e.businessType,queryString:e.queryString||"",envVersion:e.envVersion},(e._complete=function(n){if(p){var e=n.extraData;if(e)try{n.extraData=JSON.parse(e)}catch(e){n.extraData={}}}},e))},miniProgram:{navigateBack:function(e){e=e||{},O(function(){M("invokeMiniProgramAPI",{name:"navigateBack",arg:{delta:e.delta||1}},e)})},navigateTo:function(e){O(function(){M("invokeMiniProgramAPI",{name:"navigateTo",arg:{url:e.url}},e)})},redirectTo:function(e){O(function(){M("invokeMiniProgramAPI",{name:"redirectTo",arg:{url:e.url}},e)})},switchTab:function(e){O(function(){M("invokeMiniProgramAPI",{name:"switchTab",arg:{url:e.url}},e)})},reLaunch:function(e){O(function(){M("invokeMiniProgramAPI",{name:"reLaunch",arg:{url:e.url}},e)})},postMessage:function(e){O(function(){M("invokeMiniProgramAPI",{name:"postMessage",arg:e.data||{}},e)})},getEnv:function(e){O(function(){e({miniprogram:"miniprogram"===o.__wxjs_environment})})}}},T=1,k={};return i.addEventListener("error",function(e){if(!p){var n=e.target,i=n.tagName,t=n.src;if("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i)if(-1!=t.indexOf("wxlocalresource://")){e.preventDefault(),e.stopPropagation();var o=n["wx-id"];if(o||(o=T++,n["wx-id"]=o),k[o])return;k[o]=!0,wx.ready(function(){wx.getLocalImgData({localId:t,success:function(e){n.src=e.localData}})})}}},!0),i.addEventListener("load",function(e){if(!p){var n=e.target,i=n.tagName;n.src;if("IMG"==i||"VIDEO"==i||"AUDIO"==i||"SOURCE"==i){var t=n["wx-id"];t&&(k[t]=!1)}}},!0),e&&(o.wx=o.jWeixin=w),w}function M(n,e,i){o.WeixinJSBridge?WeixinJSBridge.invoke(n,x(e),function(e){A(n,e,i)}):B(n,i)}function P(n,i,t){o.WeixinJSBridge?WeixinJSBridge.on(n,function(e){t&&t.trigger&&t.trigger(e),A(n,e,i)}):B(n,t||i)}function x(e){return(e=e||{}).appId=v.appId,e.verifyAppId=v.appId,e.verifySignType="sha1",e.verifyTimestamp=v.timestamp+"",e.verifyNonceStr=v.nonceStr,e.verifySignature=v.signature,e}function V(e){return{timeStamp:e.timestamp+"",nonceStr:e.nonceStr,package:e.package,paySign:e.paySign,signType:e.signType||"SHA1"}}function A(e,n,i){"openEnterpriseChat"!=e&&"openBusinessView"!==e||(n.errCode=n.err_code),delete n.err_code,delete n.err_desc,delete n.err_detail;var t=n.errMsg;t||(t=n.err_msg,delete n.err_msg,t=function(e,n){var i=e,t=a[i];t&&(i=t);var o="ok";if(n){var r=n.indexOf(":");"confirm"==(o=n.substring(r+1))&&(o="ok"),"failed"==o&&(o="fail"),-1!=o.indexOf("failed_")&&(o=o.substring(7)),-1!=o.indexOf("fail_")&&(o=o.substring(5)),"access denied"!=(o=(o=o.replace(/_/g," ")).toLowerCase())&&"no permission to execute"!=o||(o="permission denied"),"config"==i&&"function not exist"==o&&(o="ok"),""==o&&(o="fail")}return n=i+":"+o}(e,t),n.errMsg=t),(i=i||{})._complete&&(i._complete(n),delete i._complete),t=n.errMsg||"",v.debug&&!i.isInnerInvoke&&alert(JSON.stringify(n));var o=t.indexOf(":");switch(t.substring(o+1)){case"ok":i.success&&i.success(n);break;case"cancel":i.cancel&&i.cancel(n);break;default:i.fail&&i.fail(n)}i.complete&&i.complete(n)}function C(e){if(e){for(var n=0,i=e.length;n<i;++n){var t=e[n],o=c[t];o&&(e[n]=o)}return e}}function B(e,n){if(!(!v.debug||n&&n.isInnerInvoke)){var i=a[e];i&&(e=i),n&&n._complete&&delete n._complete,console.log('"'+e+'",',n||"")}}function L(){return(new Date).getTime()}function O(e){l&&(o.WeixinJSBridge?e():i.addEventListener&&i.addEventListener("WeixinJSBridgeReady",e,!1))}});
\ No newline at end of file
... ...
{
"_from": "jweixin-module",
"_id": "jweixin-module@1.6.0",
"_inBundle": false,
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
"_location": "/jweixin-module",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "jweixin-module",
"name": "jweixin-module",
"escapedName": "jweixin-module",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"_shasum": "4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd",
"_spec": "jweixin-module",
"_where": "F:\\minigroup\\Bitcoin",
"author": {
"name": "Shengqiang Guo"
},
"bugs": {
"url": "https://github.com/zhetengbiji/jweixin-module/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "微信JS-SDK",
"devDependencies": {},
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
"keywords": [
"wxjssdk",
"weixin",
"jweixin",
"wechat",
"jssdk",
"wx"
],
"license": "ISC",
"main": "lib/index.js",
"name": "jweixin-module",
"repository": {
"type": "git",
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
},
"scripts": {},
"version": "1.6.0"
}
... ...
... ... @@ -2,6 +2,11 @@
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"uview-ui": {
"version": "2.0.31",
"resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.31.tgz",
... ...
<template>
<view class="">
<view class="mainBox">
<view class="title">比特币跌幅超61%,山寨币跌幅超80%,熊市到底了吗?</view>
<view class="title">{{detail.title}}</view>
<view class="timenev flexD">
<view class="time">
发布时间: 2022-05-22 21:56
发布时间{{detail.publishtime}}
</view>
<image src="../../static/ic_fenxiang.png" mode=""></image>
</view>
<rich-text nodes="string"></rich-text>
<rich-text :nodes="detail.content"></rich-text>
</view>
</view>
</template>
<script>
import {
arc_detail
} from '@/api/index.js'
export default {
data() {
return {
id: "",
detail: {
title: "",
publishtime: "",
content: "",
}
}
},
onLoad(options) {
this.id = options.id
this.arc_detail()
},
methods: {
//详情
async arc_detail() {
try {
const res = await arc_detail(this.id)
this.detail = res.detail
console.log('arc_detail', res)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('arc_detail', err)
}
},
}
}
</script>
<style lang="less">
.mainBox {
padding: 24rpx 31rpx;
.timenev {
margin-top: 20rpx;
color: rgba(179, 179, 179, 1);
... ...
... ... @@ -97,7 +97,6 @@
举报原因
</view>
<view class="select">
<uni-data-select v-model="value" :localdata="range" @change="change()"></uni-data-select>
<image src="../../static/ic-arrow2.png" mode=""></image>
</view>
</view>
... ... @@ -106,7 +105,7 @@
详细描述
</view>
<view class="showcont">
description
<textarea name="" id="" cols="30" rows="10" placeholder="请输入"></textarea>
</view>
</view>
<view class="btngroup">
... ... @@ -123,16 +122,14 @@
</template>
<script>
let jweixin = require('jweixin-module')
import {
product_detail,
product_favorite,
report_list
} from '@/api/index.js'
import uniselect from "@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue"
export default {
components: {
"uni-data-select": uniselect
},
data() {
return {
id: "",
... ... @@ -191,6 +188,8 @@
console.log('report_list', err)
}
},
// 举报
//收藏、取消收藏
async product_favorite() {
try {
... ... @@ -475,7 +474,7 @@
padding: 24rpx;
width: 526rpx;
height: 252rpx;
border: 2rpx solid rgba(0.9407999515533447, 0.9475764036178589, 0.9599999785423279, .3);
border: 2rpx solid rgba(0.9407999515533447, 0.9475764036178589, 0.9599999785423279, .1);
}
}
... ...
<template>
<view class="content">
<view class="top">
<view class="logo">
<image src="/static/ic_logo.png" mode=""></image>
<view class="search">
<view class="tosear" @click="gosourch">
<input type="text" value="" placeholder="搜索" disabled="true"
placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);" />
<image src="/static/icon-search.png" mode=""></image>
</view>
</view>
</view>
<view class="banner">
<u-swiper keyName="image_preview" :list="list1" @click="click" :indicator="true" indicatorMode="dot"
radius="12" height="160" :circular="true">
</u-swiper>
</view>
</view>
<view class="contail">
<view class="nev">
<view class="bar" v-for="(item,index) in categoryList" :key="index">
<image class="barimg" :src="item.image_preview" mode=""></image>
<text>{{item.name}}</text>
</view>
<view class="bar" v-if="categoryLength>8">
<image class="barimg" src="/static/logo.png" mode=""></image>
<text>更多</text>
</view>
</view>
<view class="info">
<view class="leftbox">
<view class="lefttitle">
<view class="title">
相关资讯
</view>
<view class="more">
更多
<image src="/static/ic-arrow.png" mode=""></image>
</view>
</view>
<view class="newbar">
<view v-for="(item,index) in informationList" :key="index">·{{item.title}}</view>
</view>
</view>
<view class="rightbox">
<view class="righttitle">
<view class="title">
相关资讯
</view>
<view class="active">
充值活动
</view>
</view>
<view class="activeimg">
<image src="/static/Rectangle 2372.png" mode=""></image>
<!-- <image src="/static/logo.png" mode=""></image>
<image src="/static/logo.png" mode=""></image> -->
</view>
</view>
</view>
<view class="waterfall">
<view class="falltitle">
<view class="fallnev" :class="{newfall:fallindex==1}" @click="changefall(1)">
猜你喜欢
<view class="tip">
</view>
</view>
<view class="fallnev" :class="{newfall:fallindex==2}" @click="changefall(2)">
最新
<view class="tip">
</view>
</view>
<view class="fallnev" :class="{newfall:fallindex==3}" @click="changefall(3)">
人气
<view class="tip">
</view>
</view>
</view>
<view class="misslist">
<custom-waterfalls-flow :value="list" @wapperClick="godetail">
<template v-slot:default="item">
<view class="item">
<view class="title">{{item.name}}</view>
<view class="types">
所属分类:{{item.sort.name}}
</view>
<view class="desc">
<text v-if="item.seller_name">{{item.seller_name}}</text>
<view class="money">
<text>¥</text>{{item.price}}
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</view>
</view>
</view>
<Botton :flag="1"></Botton>
</view>
</template>
<script>
import {
getBanner,
sortList,
arcList,
product_list,
product_report
} from '@/api/index'
import helangWaterfall from "@/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue"
import Botton from "@/components/Botton.vue"
export default {
components: {
"custom-waterfalls-flow": helangWaterfall,
"Botton": Botton
},
data() {
return {
title: 'Hello',
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
nevlist: [1, 2, 3, 4, , 6, 7],
leftlist: [1, 2, 3],
fallindex: 1,
//瀑布
list: [],
categoryList: [], // 分类列表
categoryLength: 0, //分类数量
informationList: [], // 相关资讯
currentpage: 1, //分页
}
},
onShow() {
this.initial()
this.product_list()
},
onLoad() {
},
methods: {
//产品举报
async product_report(){
let obj={
product_id:this.id,
report_id:"",
content:"",
}
try {
// 轮播图
const res = await getBanner()
// 分类
const sortRes = await sortList(1)
// 相关资讯
const information= await arcList()
// 轮播图
this.list1 =res.list
this.categoryLength = sortRes.list.length
this.categoryList = sortRes.list.length>8?sortRes.list.slice(0,7):sortRes.list
this.informationList = information.list.length>3?information.list.slice(0,3):information.list
console.log(sortRes,'分类');
console.log('getBanner', res)
console.log(information,'资讯列表');
const result = await product_report(obj)
console.log('product_report', result)
// 保存数据
} catch (err) {
uni.showToast({ title:err,icon:'none' })
console.log('product_report', err)
}
},
//产品列表
async product_list() {
let obj = {
type: this.fallindex,
page: this.currentpage,
pagenum: 15,
}
try {
const res = await product_list(obj)
console.log('产品列表', res)
this.list = res.list.data
this.list.forEach((item, index) => {
item.image = item.images_preview[0]
})
console.log('产品列表', this.list)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('product_list', err)
}
},
async initial() {
try {
// 轮播图
const res = await getBanner()
// 分类
const sortRes = await sortList()
// 相关资讯
const information = await arcList()
// 轮播图
this.list1 = res.list
this.categoryLength = sortRes.list.length
this.categoryList = sortRes.list.length > 8 ? sortRes.list.slice(0, 7) : sortRes.list
this.informationList = information.list.length > 3 ? information.list.slice(0, 3) : information
.list
console.log(sortRes, '分类');
console.log('getBanner', res)
console.log(information, '资讯列表');
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('getBanner', err)
}
},
changefall(e) {
this.fallindex = e
},
//跳转详情
godetail(item) {
console.log(1)
uni.navigateTo({
url: "/pages/index/detail?id=" +item.id
})
},
//跳转搜索
gosourch() {
uni.navigateTo({
url: "/pages/index/search"
})
},
}
}
</script>
<style lang="scss">
page {
background: rgba(246, 246, 246, 1);
}
.content {
.top {
height: 370rpx;
background-image: linear-gradient(#FED000, #ffffff);
padding: 32rpx;
.logo {
display: flex;
align-items: center;
image {
width: 84rpx;
height: 74rpx;
margin-right: 36rpx;
}
.search {
flex: 1;
display: flex;
align-items: center;
.tosear {
position: relative;
width: 522rpx;
height: 64rpx;
border-radius: 38rpx;
opacity: 1;
border: 0 solid rgba(0.5920000076293945, 0.5920000076293945, 0.5920000076293945, 1);
background: rgba(245, 245, 245, 1);
padding: 0 32rpx;
input {
text-align: center;
width: 100%;
height: 100%;
}
image {
position: absolute;
left: 280rpx;
top: 50%;
left: 36%;
transform: translateY(-50%);
width: 32rpx;
height: 32rpx;
}
}
}
}
.banner {
margin-top: 32rpx;
height: 320rpx;
border-radius: 24rpx;
}
}
.contail {
padding: 0 32rpx;
padding-bottom: 160rpx;
box-sizing: border-box;
.nev {
margin-top: 48rpx;
border-radius: 24rpx;
padding: 0 32rpx;
box-sizing: border-box;
padding-bottom: 32rpx;
background: rgba(255, 255, 255, 1);
display: flex;
flex-wrap: wrap;
.bar {
margin-top: 40rpx;
margin-right: 68rpx;
width: 104rpx;
height: 124rpx;
display: flex;
flex-direction: column;
align-items: center;
color: rgba(0, 0, 0, 0.9);
font-size: 26rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: center;
.barimg {
width: 80rpx;
height: 80rpx;
}
&:nth-child(4n) {
margin-right: 0;
}
}
}
.info {
display: flex;
margin-top: 24rpx;
.leftbox {
flex: 1;
padding: 24rpx;
margin-right: 22rpx;
box-sizing: border-box;
background: linear-gradient(180deg, rgba(255, 242, 242, 1) 0%, rgba(255, 255, 255, 1) 100%);
.lefttitle {
display: flex;
align-items: center;
justify-content: space-between;
.title {
opacity: 1;
color: rgba(0, 0, 0, 1);
font-size: 30rpx;
font-weight: 500;
font-family: "PingFang SC";
}
.more {
display: flex;
align-items: center;
image {
width: 16rpx;
height: 32rpx;
}
}
}
.newbar {
color: rgba(0, 0, 0, 0.9);
font-size: 22rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
view {
margin-top: 16rpx;
}
}
}
.rightbox {
flex: 1;
padding: 24rpx;
box-sizing: border-box;
background: linear-gradient(180deg, rgba(255, 250, 231, 1) 0%, rgba(255, 255, 255, 1) 100%);
.righttitle {
display: flex;
align-items: center;
.title {
color: rgba(50, 50, 51, 1);
font-size: 30rpx;
font-weight: 500;
font-family: "PingFang SC";
}
.active {
margin-left: 16rpx;
width: 104rpx;
height: 32rpx;
border-radius: 6rpx;
opacity: 1;
color: rgba(255, 255, 255, 1);
font-size: 20rpx;
font-weight: 500;
font-family: "PingFang SC";
line-height: 32rpx;
text-align: center;
background: linear-gradient(90deg, rgba(255, 61, 61, 1) 0%, rgba(255, 122, 48, 1) 100%);
}
}
.activeimg {
margin-top: 12rpx;
display: flex;
align-items: center;
justify-content: space-between;
image {
width: 284rpx;
height: 136rpx;
border-radius: 24rpx;
}
// image {
// width: 134rpx;
// height: 136rpx;
// border-radius: 24rpx;
// }
}
}
}
.waterfall {
color: rgba(0, 0, 0, 0.9);
font-size: 30rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
.falltitle {
color: rgba(0, 0, 0, 0.9);
font-size: 30rpx;
font-weight: 400;
font-family: "PingFang SC";
margin-top: 24rpx;
display: flex;
align-items: center;
.fallnev {
margin-right: 40rpx;
.tip {
width: 0;
height: 0;
}
}
.newfall {
position: relative;
color: rgba(0, 0, 0, 0.9);
font-size: 36rpx;
font-weight: 600;
font-family: "PingFang SC";
.tip {
position: absolute;
bottom: 0;
right: 0;
width: 64rpx;
height: 12rpx;
border-radius: 14rpx;
opacity: 1;
background: rgba(254, 208, 0, .6);
}
}
}
.misslist {
margin-top: 24rpx;
.item {
padding: 24rpx;
box-sizing: border-box;
.types {
margin-top: 8rpx;
color: rgba(0, 0, 0, 0.6);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
}
.desc {
margin-top: 14rpx;
display: flex;
align-items: center;
justify-content: space-between;
color: rgba(0, 0, 0, 0.6);
font-size: 20rpx;
font-weight: 400;
font-family: "PingFang SC";
.money {
color: rgba(248, 83, 23, 1);
font-size: 32rpx;
font-weight: 700;
font-family: "Montserrat";
text {
font-size: 24rpx;
font-weight: 500;
}
}
}
}
}
}
}
}
<template>
<view class="content">
<view class="top">
<view class="logo">
<image src="/static/ic_logo.png" mode=""></image>
<view class="search">
<view class="tosear" @click="gosourch">
<input type="text" value="" placeholder="搜索" disabled="true"
placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);" />
<image src="/static/icon-search.png" mode=""></image>
</view>
</view>
</view>
<view class="banner">
<u-swiper keyName="image_preview" :list="list1" @click="click" :indicator="true" indicatorMode="dot"
radius="12" height="160" :circular="true">
</u-swiper>
</view>
</view>
<view class="contail">
<view class="nev">
<view class="bar" v-for="(item,index) in categoryList" :key="index">
<image class="barimg" :src="item.image_preview" mode=""></image>
<text>{{item.name}}</text>
</view>
<view class="bar" v-if="categoryLength>8">
<image class="barimg" src="/static/logo.png" mode=""></image>
<text>更多</text>
</view>
</view>
<view class="info">
<view class="leftbox">
<view class="lefttitle">
<view class="title">
相关资讯
</view>
<view class="more" @click="torealtime(1)">
更多
<image src="/static/ic-arrow.png" mode=""></image>
</view>
</view>
<view class="newbar">
<view v-for="(item,index) in informationList" :key="index">·{{item.title}}</view>
</view>
</view>
<view class="rightbox" @click="torealtime(2)">
<view class="righttitle">
<view class="title">
相关资讯
</view>
<view class="active">
充值活动
</view>
</view>
<view class="activeimg">
<image src="/static/Rectangle 2372.png" mode=""></image>
<!-- <image src="/static/logo.png" mode=""></image>
<image src="/static/logo.png" mode=""></image> -->
</view>
</view>
</view>
<view class="waterfall">
<view class="falltitle">
<view class="fallnev" :class="{newfall:fallindex==1}" @click="changefall(1)">
猜你喜欢
<view class="tip">
</view>
</view>
<view class="fallnev" :class="{newfall:fallindex==2}" @click="changefall(2)">
最新
<view class="tip">
</view>
</view>
<view class="fallnev" :class="{newfall:fallindex==3}" @click="changefall(3)">
人气
<view class="tip">
</view>
</view>
</view>
<scroll-view scroll-y="true" @scrolltolower="scrolltolower" style="height: 100vh">
<view class="misslist">
<custom-waterfalls-flow :value="list" @wapperClick="godetail">
<template v-slot:default="item">
<view class="item">
<view class="title">{{item.name}}</view>
<view class="types">
所属分类:{{item.sort.name}}
</view>
<view class="desc">
<text v-if="item.seller_name">{{item.seller_name}}</text>
<view class="money">
<text>¥</text>{{item.price}}
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</view>
</scroll-view>
</view>
</view>
<Botton :flag="1"></Botton>
</view>
</template>
<script>
import {
getBanner,
sortList,
arcList,
product_list,
product_report
} from '@/api/index'
import helangWaterfall from "@/uni_modules/custom-waterfalls-flow/components/custom-waterfalls-flow/custom-waterfalls-flow.vue"
import Botton from "@/components/Botton.vue"
export default {
components: {
"custom-waterfalls-flow": helangWaterfall,
"Botton": Botton
},
data() {
return {
title: 'Hello',
list1: [
'https://cdn.uviewui.com/uview/swiper/swiper1.png',
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
nevlist: [1, 2, 3, 4, , 6, 7],
leftlist: [1, 2, 3],
fallindex: 1,
//瀑布
list: [],
categoryList: [], // 分类列表
categoryLength: 0, //分类数量
informationList: [], // 相关资讯
currentpage: 1, //分页
}
},
onShow() {
this.initial()
this.product_list(true)
},
onLoad() {
},
methods: {
//咨询列表
torealtime(e) {
uni.navigateTo({
url: "/pages/index/realTimeInfo?type=" + e
})
},
scrolltolower() {
this.currentpage++
this.product_list()
},
async product_report() {
let obj = {
product_id: this.id,
report_id: "",
content: "",
}
try {
// 轮播图
const res = await getBanner()
// 分类
const sortRes = await sortList(1)
// 相关资讯
const information = await arcList()
// 轮播图
this.list1 = res.list
this.categoryLength = sortRes.list.length
this.categoryList = sortRes.list.length > 8 ? sortRes.list.slice(0, 7) : sortRes.list
this.informationList = information.list.length > 3 ? information.list.slice(0, 3) : information
.list
console.log(sortRes, '分类');
console.log('getBanner', res)
console.log(information, '资讯列表');
const result = await product_report(obj)
console.log('product_report', result)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('product_report', err)
}
},
//产品列表
async product_list(x) {
let obj = {
type: this.fallindex,
page: this.currentpage,
pagenum: 15,
}
try {
const res = await product_list(obj)
console.log('产品列表', res)
this.list = x ? res.list.data : this.list.concat(res.list.data)
this.list.forEach((item, index) => {
item.image = item.images_preview[0]
})
if (res.list.data.length == 0) {
uni.showToast({
title: "暂无更多数据",
icon: 'none'
})
return
}
console.log('产品列表', this.list)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('product_list', err)
}
},
async initial() {
try {
// 轮播图
const res = await getBanner()
// 分类
const sortRes = await sortList()
// 相关资讯
const information = await arcList()
// 轮播图
this.list1 = res.list
this.categoryLength = sortRes.list.length
this.categoryList = sortRes.list.length > 8 ? sortRes.list.slice(0, 7) : sortRes.list
this.informationList = information.list.length > 3 ? information.list.slice(0, 3) : information
.list
console.log(sortRes, '分类');
console.log('getBanner', res)
console.log(information, '资讯列表');
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('getBanner', err)
}
},
changefall(e) {
this.fallindex = e
this.list = []
this.product_list(true)
},
//跳转详情
godetail(item) {
console.log(1)
uni.navigateTo({
url: "/pages/index/detail?id=" + item.id
})
},
//跳转搜索
gosourch() {
uni.navigateTo({
url: "/pages/index/search"
})
},
}
}
</script>
<style lang="scss">
page {
background: rgba(246, 246, 246, 1);
}
.content {
.top {
height: 370rpx;
background-image: linear-gradient(#FED000, #ffffff);
padding: 32rpx;
.logo {
display: flex;
align-items: center;
image {
width: 84rpx;
height: 74rpx;
margin-right: 36rpx;
}
.search {
flex: 1;
display: flex;
align-items: center;
.tosear {
position: relative;
width: 522rpx;
height: 64rpx;
border-radius: 38rpx;
opacity: 1;
border: 0 solid rgba(0.5920000076293945, 0.5920000076293945, 0.5920000076293945, 1);
background: rgba(245, 245, 245, 1);
padding: 0 32rpx;
input {
text-align: center;
width: 100%;
height: 100%;
}
image {
position: absolute;
left: 280rpx;
top: 50%;
left: 36%;
transform: translateY(-50%);
width: 32rpx;
height: 32rpx;
}
}
}
}
.banner {
margin-top: 32rpx;
height: 320rpx;
border-radius: 24rpx;
}
}
.contail {
padding: 0 32rpx;
padding-bottom: 160rpx;
box-sizing: border-box;
.nev {
margin-top: 48rpx;
border-radius: 24rpx;
padding: 0 32rpx;
box-sizing: border-box;
padding-bottom: 32rpx;
background: rgba(255, 255, 255, 1);
display: flex;
flex-wrap: wrap;
.bar {
margin-top: 40rpx;
margin-right: 68rpx;
width: 104rpx;
height: 124rpx;
display: flex;
flex-direction: column;
align-items: center;
color: rgba(0, 0, 0, 0.9);
font-size: 26rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: center;
.barimg {
width: 80rpx;
height: 80rpx;
}
&:nth-child(4n) {
margin-right: 0;
}
}
}
.info {
display: flex;
margin-top: 24rpx;
.leftbox {
flex: 1;
padding: 24rpx;
margin-right: 22rpx;
box-sizing: border-box;
background: linear-gradient(180deg, rgba(255, 242, 242, 1) 0%, rgba(255, 255, 255, 1) 100%);
.lefttitle {
display: flex;
align-items: center;
justify-content: space-between;
.title {
opacity: 1;
color: rgba(0, 0, 0, 1);
font-size: 30rpx;
font-weight: 500;
font-family: "PingFang SC";
}
.more {
display: flex;
align-items: center;
color: rgba(0, 0, 0, 0.9);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
image {
width: 16rpx;
height: 32rpx;
}
}
}
.newbar {
color: rgba(0, 0, 0, 0.9);
font-size: 22rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
view {
margin-top: 16rpx;
}
}
}
.rightbox {
flex: 1;
padding: 24rpx;
box-sizing: border-box;
background: linear-gradient(180deg, rgba(255, 250, 231, 1) 0%, rgba(255, 255, 255, 1) 100%);
.righttitle {
display: flex;
align-items: center;
.title {
color: rgba(50, 50, 51, 1);
font-size: 30rpx;
font-weight: 500;
font-family: "PingFang SC";
}
.active {
margin-left: 16rpx;
width: 104rpx;
height: 32rpx;
border-radius: 6rpx;
opacity: 1;
color: rgba(255, 255, 255, 1);
font-size: 20rpx;
font-weight: 500;
font-family: "PingFang SC";
line-height: 32rpx;
text-align: center;
background: linear-gradient(90deg, rgba(255, 61, 61, 1) 0%, rgba(255, 122, 48, 1) 100%);
}
}
.activeimg {
margin-top: 12rpx;
display: flex;
align-items: center;
justify-content: space-between;
image {
width: 284rpx;
height: 136rpx;
border-radius: 24rpx;
}
// image {
// width: 134rpx;
// height: 136rpx;
// border-radius: 24rpx;
// }
}
}
}
.waterfall {
color: rgba(0, 0, 0, 0.9);
font-size: 30rpx;
font-weight: 400;
font-family: "PingFang SC";
text-align: left;
.falltitle {
color: rgba(0, 0, 0, 0.9);
font-size: 30rpx;
font-weight: 400;
font-family: "PingFang SC";
margin-top: 24rpx;
display: flex;
align-items: center;
.fallnev {
margin-right: 40rpx;
.tip {
width: 0;
height: 0;
}
}
.newfall {
position: relative;
color: rgba(0, 0, 0, 0.9);
font-size: 36rpx;
font-weight: 600;
font-family: "PingFang SC";
.tip {
position: absolute;
bottom: 0;
right: 0;
width: 64rpx;
height: 12rpx;
border-radius: 14rpx;
opacity: 1;
background: rgba(254, 208, 0, .6);
}
}
}
.misslist {
margin-top: 24rpx;
.item {
padding: 24rpx;
box-sizing: border-box;
.types {
margin-top: 8rpx;
color: rgba(0, 0, 0, 0.6);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
}
.desc {
margin-top: 14rpx;
display: flex;
align-items: center;
justify-content: space-between;
color: rgba(0, 0, 0, 0.6);
font-size: 20rpx;
font-weight: 400;
font-family: "PingFang SC";
.money {
color: rgba(248, 83, 23, 1);
font-size: 32rpx;
font-weight: 700;
font-family: "Montserrat";
text {
font-size: 24rpx;
font-weight: 500;
}
}
}
}
}
}
}
}
</style>
... ...
<template>
<view class="product_all">
<view class="top">
<image src="../../static/ic-back-false.png" mode=""></image>
<image src="../../static/ic-back-false.png" mode="" @click="back"></image>
<view class="search">
<view class="tosear" @click="gosourch">
<input type="text" value="" placeholder="搜索"
placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);" />
placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);"
v-model="keyword" />
<image src="../../static/icon-search.png" mode=""></image>
</view>
</view>
</view>
<view class="misslist">
<custom-waterfalls-flow :value="list">
<!-- #ifdef MP-WEIXIN -->
<view class="item" v-for="(item,index) in list" :key="index" slot="slot{{index}}">
<view class="title">{{item.title}}</view>
<view class="desc">
<text>张三</text>
<view class="money">
<text>¥</text>6666
</view>
</view>
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<template v-slot:default="item">
<view class="item">
<view class="title">{{item.title}}</view>
<view class="desc">
<text>张三</text>
<view class="money">
<text>¥</text>6666
<scroll-view scroll-y="true" @scrolltolower="scrolltolower" style="height: 100vh">
<view class="misslist">
<custom-waterfalls-flow :value="list" @wapperClick="godetail">
<template v-slot:default="item">
<view class="item">
<view class="title">{{item.name}}</view>
<view class="types">
所属分类:{{item.sort.name}}
</view>
<view class="desc">
<text v-if="item.seller_name">{{item.seller_name}}</text>
<view class="money">
<text>¥</text>{{item.price}}
</view>
</view>
</view>
</view>
</template>
<!-- #endif -->
</custom-waterfalls-flow>
</view>
</template>
</custom-waterfalls-flow>
</view>
</scroll-view>
</view>
</template>
<script>
import {
product_list
} from '@/api/index'
export default {
data() {
return {
//瀑布
list: [{
image: 'https://via.placeholder.com/200x500.png/ff0000',
title: '我是标题1',
},
{
image: 'https://via.placeholder.com/200x200.png/2878ff',
title: '我是标题2',
}, {
image: 'https://via.placeholder.com/200x200.png/2878ff',
title: '我是标题2',
},
{
image: 'https://via.placeholder.com/200x200.png/2878ff',
title: '我是标题2',
},
{
image: 'https://via.placeholder.com/200x200.png/2878ff',
title: '我是标题2',
}
]
list: [],
keyword: "",
currentpage: 1,
}
},
onLoad(options) {
this.keyword = options.ktext
this.product_list(true)
},
methods: {
scrolltolower() {
this.currentpage++
this.product_list()
},
back() {
uni.navigateBack({
delta: 1
})
},
//产品列表
async product_list(x) {
let obj = {
keyword: this.keyword,
page: this.currentpage,
pagenum: 15,
}
try {
const res = await product_list(obj)
console.log('产品列表', res)
this.list = x ? res.list.data : this.list.concat(res.list.data)
this.list.forEach((item, index) => {
item.image = item.images_preview[0]
})
if (res.list.data.length == 0) {
uni.showToast({
title: "暂无更多数据",
icon: 'none'
})
return
}
console.log('产品列表', this.list)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('product_list', err)
}
},
}
}
</script>
... ... @@ -135,12 +159,20 @@
}
.misslist {
margin-top: 132rpx;
margin-top: 104rpx;
.item {
padding: 24rpx;
box-sizing: border-box;
.types {
margin-top: 8rpx;
color: rgba(0, 0, 0, 0.6);
font-size: 24rpx;
font-weight: 400;
font-family: "PingFang SC";
}
.desc {
margin-top: 14rpx;
display: flex;
... ...
... ... @@ -32,7 +32,10 @@
<image class="image_b" @click="upload(2)" v-if="!imageF" src="/static/icon_square_cream.png" mode=""></image>
</view>
</view>
<view class="btn">
<<<<<<< HEAD
=======
<view class="paybtn" >
<input type="text" placeholder="请输入" v-model="name">
</view>
... ... @@ -55,6 +58,7 @@
</view>
</view>
<view class="btn">
>>>>>>> b13657550df89f042b3116430c8734e3d789d7fc
<view class="paybtn" @click="realAuthentication">
提交
</view>
... ...
... ... @@ -2,12 +2,13 @@
<view class="timeInfo">
<view class="nevtop">
<view class="top">
<u-search placeholder="请输入文章名称搜索" v-model="keyword" :clearabled="true" :show-action="false"></u-search>
<u-search placeholder="请输入文章名称搜索" v-model="keyword" :clearabled="true" :show-action="false"
@search="onsouch()"></u-search>
</view>
<view class="banner">
<scroll-view scroll-x="true" style="white-space:nowrap ">
<view class="nav" :class="{newnav:chooseindex==index}" v-for="(item,index) in typelist" :key="index"
@click="choose(index)">发发发
@click="choose(index,item.id)">{{item.name}}
<view class="tip" v-if="chooseindex==index">
</view>
</view>
... ... @@ -15,34 +16,115 @@
</view>
</view>
<view class="group">
<view class="item" v-for="(item,idx) in 20" :key="idx">
<view class="bot flexA">
<view class="left flexA">
<image src="/static/logo.png" mode=""></image>
<view class="">
<view class="title">比特币20个</view>
<view class="time">发布时间:2022-06-21 15:31</view>
<scroll-view scroll-y="true" @scrolltolower="scrolltolower" style="height: 100vh">
<view class="item" v-for="(item,idx) in sortlist" :key="idx" @click="ondetail(item.id)">
<view class="bot flexA">
<view class="left flexA">
<image :src="item.image_preview" mode=""></image>
<view class="">
<view class="title">{{item.title}}</view>
<view class="time">发布时间:{{item.publishtime}}</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import {
sort_list,
arc_list
} from '@/api/index.js'
export default {
data() {
return {
chooseindex: 0,
typelist: [1, , , 3, , 3, , , 4, , , , 4, ],
typelist: [],
keyword: "",
sortlist: [],
currentpage: 1,
}
},
onLoad(options) {
this.type = options.type
this.sort_list(true)
},
methods: {
choose(e) {
ondetail(e) {
uni.navigateTo({
url: "/pages/index/consultationDetails?id=" + e
})
},
// 加载
scrolltolower() {
this.currentpage++
this.arc_list()
},
//搜索
onsouch() {
this.currentpage = 1
this.arc_list(true)
},
//类型选择
choose(e, id) {
this.chooseindex = e
}
this.sortlist = []
this.sort_id = id
this.arc_list(true)
},
// 分类
async sort_list() {
let obj = {
type: this.type,
keyword: this.keyword,
}
try {
const res = await sort_list()
this.typelist = res.list
this.sort_id = this.typelist[0].id
this.arc_list(true)
console.log('sort_list', res)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('sort_list', err)
}
},
// 资讯
async arc_list(x) {
let obj = {
type:this.type,
sort_id: this.sort_id,
keyword: this.keyword,
page: this.currentpage,
pagenum: 15,
}
try {
const res = await arc_list(obj)
this.sortlist = x ? res.list.data : this.sortlist.concat(res.list.data)
console.log('arc_list', res)
if (res.list.data.length == 0) {
uni.showToast({
title: "暂无更多数据",
icon: 'none'
})
return
}
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('arc_list', err)
}
},
}
}
</script>
... ... @@ -56,9 +138,10 @@
.nevtop {
position: fixed;
width: 100%;
box-sizing: border-box;
top: 0;
left: 0;
z-index:99;
z-index: 99;
padding: 16rpx 32rpx;
background-color: #ffffff;
... ...
<template>
<view class="top">
<u-search :showAction="true" actionText="搜索" :clearabled="true"></u-search>
<u-search :showAction="true" actionText="搜索" :clearabled="true" v-model="ktext" @custom="onsouch(ktext)">
</u-search>
<view class="main">
<view class="title">
<text>历史搜索</text>
<image src="../../static/ic-delete-false.png" mode="" @click="delhostily"></image>
</view>
<view class="schbox">
<view class="schitem" v-for="(item,index) in hostlist" :key="index"
@click="onsouch(item.history.history_name)">
11
<view class="schitem" v-for="(item,index) in hostlist" :key="index" @click="onsouch(item.keyword)">
{{item.keyword}}
</view>
</view>
</view>
... ... @@ -18,13 +18,70 @@
</template>
<script>
import {
search_list,
search_clear
} from '@/api/index.js'
export default {
data() {
return {
hostlist: [1, 23, 3]
hostlist: [],
ktext: "",
};
},
methods: {},
onLoad() {
},
onShow() {
this.search_list()
},
methods: {
delhostily() {
let that=this
uni.showModal({
content:"是否删除历史搜索记录",
success(res) {
if (res.confirm) {
that.search_clear()
that.search_list()
}
}
})
},
onsouch(e) {
uni.navigateTo({
url: "/pages/index/product?ktext=" + e
})
},
//清除历史搜索记录
async search_clear() {
try {
const res = await search_clear()
console.log('search_clear', res)
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('search_clear', err)
}
},
// 历史搜索记录
async search_list() {
try {
const res = await search_list()
console.log('search_list', res)
this.hostlist = res.list
// 保存数据
} catch (err) {
uni.showToast({
title: err,
icon: 'none'
})
console.log('search_list', err)
}
},
},
}
</script>
... ...