更换版本
This commit is contained in:
318
packageA/pages/yjcx/yjcx.js
Normal file
318
packageA/pages/yjcx/yjcx.js
Normal file
@@ -0,0 +1,318 @@
|
||||
var a;
|
||||
(a = getApp()),
|
||||
Page({
|
||||
data: {
|
||||
highe: wx.getSystemInfoSync().windowHeight,
|
||||
width: wx.getSystemInfoSync().windowWidth,
|
||||
showModal: !1,
|
||||
stepList: [],
|
||||
todaystep: 0,
|
||||
imagePath: "",
|
||||
page: 1,
|
||||
topNum: 0,
|
||||
userinfo: {},
|
||||
classid: 0,
|
||||
moduleList: [
|
||||
{
|
||||
name: "打字信件",
|
||||
desc: "输入你想说的话,短信通知Ta",
|
||||
is_shield: 0,
|
||||
url: "/pages/baike/biaobai/index",
|
||||
redirect: "listen",
|
||||
is_out: 0,
|
||||
},
|
||||
{
|
||||
name: "提取信件",
|
||||
desc: "输入手机号提取你的信件",
|
||||
is_shield: 0,
|
||||
need_shield: 1,
|
||||
url: "/packageA/pages/carcx/index",
|
||||
redirect: "dubbing",
|
||||
is_out: 0,
|
||||
},
|
||||
{
|
||||
name: "文字文案",
|
||||
desc: "文字纯文字文案素材库",
|
||||
is_shield: 0,
|
||||
need_shield: 1,
|
||||
url: "/packageA/pages/cardzbd/incxjl",
|
||||
redirect: "oral",
|
||||
is_out: 0,
|
||||
},
|
||||
],
|
||||
moduleListc: [
|
||||
{
|
||||
name: "文案背景",
|
||||
desc: "背景寻找文案配图中心",
|
||||
is_shield: 0,
|
||||
url: "/packageA/pages/carclzt/incxjl",
|
||||
redirect: "listen",
|
||||
is_out: 0,
|
||||
},
|
||||
{
|
||||
name: "特效文案",
|
||||
desc: "特殊字符组成的文案",
|
||||
is_shield: 0,
|
||||
need_shield: 1,
|
||||
url: "/packageA/pages/carjqx/incxjl",
|
||||
redirect: "oral",
|
||||
is_out: 0,
|
||||
},
|
||||
{
|
||||
name: "文案原创",
|
||||
desc: "输入你的文案变成原创",
|
||||
is_shield: 0,
|
||||
url: "/packageA/pages/carnj/incxjl",
|
||||
redirect: "listen",
|
||||
is_out: 0,
|
||||
},
|
||||
],
|
||||
},
|
||||
onLoad: function (a) {
|
||||
this.Load(), this.getsys();
|
||||
},
|
||||
getsys: function () {
|
||||
var t = this,
|
||||
e = { uid: wx.getStorageSync("uid") };
|
||||
a.getdata(e, "Yjcax").then((a) => {
|
||||
if ((console.log("油价", a), a)) {
|
||||
var e = a.price;
|
||||
let i = [];
|
||||
for (var o in e)
|
||||
if (
|
||||
"hao0" == [o] ||
|
||||
"hao90" == [o] ||
|
||||
"hao92" == [o] ||
|
||||
"hao95" == [o] ||
|
||||
"hao98" == [o]
|
||||
) {
|
||||
let a = { name: o.replace("hao", "汽油") + "#", value: e[o] };
|
||||
i.push(a);
|
||||
}
|
||||
t.setData({ yjcx: i, yjdata: a });
|
||||
}
|
||||
});
|
||||
},
|
||||
imgPreview: function (t) {
|
||||
console.log(t.currentTarget.dataset.id),
|
||||
this.data.jlad &&
|
||||
a.videoad(this.data.jlad, "观看视频广告获取最新金价~").then((a) => {
|
||||
console.log("回调广告:", a);
|
||||
});
|
||||
},
|
||||
chaping: function () {
|
||||
let a = null;
|
||||
wx.createInterstitialAd &&
|
||||
((a = wx.createInterstitialAd({ adUnitId: this.data.cpad })),
|
||||
a.onLoad(() => {}),
|
||||
a.onError((a) => {}),
|
||||
a.onClose(() => {})),
|
||||
setTimeout(function () {
|
||||
a &&
|
||||
a.show().catch((a) => {
|
||||
console.error(a);
|
||||
});
|
||||
}, 3e3);
|
||||
},
|
||||
HUASHU: function (t) {
|
||||
wx.pageScrollTo({ scrollTop: 0 }),
|
||||
this.setData({ classid: t.currentTarget.dataset.classid, page: 1 });
|
||||
var e = { nodeid: t.currentTarget.dataset.classid, page: this.data.page };
|
||||
if (0 == this.data.classid) this.Load();
|
||||
else {
|
||||
var o = this,
|
||||
i = this.data.classid;
|
||||
(e = {
|
||||
model: "article",
|
||||
key: a.globalData.Key,
|
||||
tid: i,
|
||||
limit: 10,
|
||||
page: o.data.page,
|
||||
}),
|
||||
a.getdata(e, "GetData/getDataPage").then((a) => {
|
||||
console.log("回调数据:", a.data.data),
|
||||
o.setData({ xcx: a.data.data }),
|
||||
o.goTop();
|
||||
});
|
||||
}
|
||||
},
|
||||
goto: function (t) {
|
||||
console.log(t.currentTarget.dataset.id),
|
||||
this.data.jlad
|
||||
? a.videoad(this.data.jlad, "观看视频广告解锁改素材~").then((a) => {
|
||||
console.log("回调广告:", a),
|
||||
1 == a &&
|
||||
wx.navigateTo({
|
||||
url: "../detail/detail?id=" + t.currentTarget.dataset.id,
|
||||
success: (a) => {},
|
||||
fail: (a) => {},
|
||||
});
|
||||
})
|
||||
: wx.navigateTo({
|
||||
url: "../detail/detail?id=" + t.currentTarget.dataset.id,
|
||||
success: (a) => {},
|
||||
fail: (a) => {},
|
||||
});
|
||||
},
|
||||
bindSearch: function (a) {
|
||||
this.data.keyword
|
||||
? wx.navigateTo({
|
||||
url: "../search/search?keyword=" + this.data.keyword,
|
||||
})
|
||||
: wx.showModal({ title: "温馨提示~", content: "请输入搜索内容" });
|
||||
},
|
||||
bindKeyword: function (a) {
|
||||
this.setData({ keyword: a.detail.value });
|
||||
},
|
||||
fabu: function (a) {
|
||||
this.data.userdata
|
||||
? wx.navigateTo({ url: "../fabu/fabu" })
|
||||
: wx.navigateTo({ url: "../../login/login" });
|
||||
},
|
||||
pullLoad: function (t) {
|
||||
var e = this,
|
||||
o = {
|
||||
model: "article",
|
||||
key: a.globalData.Key,
|
||||
tid: 1,
|
||||
limit: 10,
|
||||
page: e.data.page + 1,
|
||||
};
|
||||
if (0 == this.data.classid)
|
||||
a.getdata(o, "GetData/getDataPage").then((a) => {
|
||||
console.log("回调数据:", a.data.data),
|
||||
e.setData({
|
||||
xcx: e.data.xcx.concat(a.data.data),
|
||||
page: e.data.page + 1,
|
||||
floorstatus: !0,
|
||||
});
|
||||
});
|
||||
else {
|
||||
t = this;
|
||||
var i = this.data.classid;
|
||||
(o = {
|
||||
model: "article",
|
||||
key: a.globalData.Key,
|
||||
tid: i,
|
||||
limit: 10,
|
||||
page: t.data.page + 1,
|
||||
}),
|
||||
a.getdata(o, "GetData/getDataPage").then((a) => {
|
||||
console.log("回调数据:", a.data.data),
|
||||
t.setData({
|
||||
xcx: e.data.xcx.concat(a.data.data),
|
||||
page: e.data.page + 1,
|
||||
floorstatus: !0,
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
scrolltoupper: function (a) {
|
||||
console.log(a),
|
||||
a.detail.scrollTop > 100
|
||||
? this.setData({ cangotop: !0 })
|
||||
: this.setData({ cangotop: !1 });
|
||||
},
|
||||
goTop: function (a) {
|
||||
this.setData({ topNum: 0 });
|
||||
},
|
||||
gohome: function (a) {
|
||||
wx.navigateToMiniProgram({
|
||||
appId: this.data.adappid,
|
||||
path: this.data.adappidpage,
|
||||
extarData: { open: "happy" },
|
||||
envVersion: "release",
|
||||
success(a) {},
|
||||
});
|
||||
},
|
||||
navto: function (a) {
|
||||
console.log(a),
|
||||
a.currentTarget.dataset.url,
|
||||
wx.navigateToMiniProgram({
|
||||
appId: this.data.appid,
|
||||
path: "",
|
||||
extarData: { open: "happy" },
|
||||
envVersion: "release",
|
||||
success(a) {},
|
||||
});
|
||||
},
|
||||
Load: function (t) {
|
||||
var e = this,
|
||||
o = {
|
||||
model: "article",
|
||||
key: a.globalData.Key,
|
||||
tid: 1,
|
||||
limit: 10,
|
||||
page: e.data.page,
|
||||
};
|
||||
a.getdata(o, "GetData/getDataPage").then((a) => {
|
||||
console.log("回调数据:", a.data.data), e.setData({ xcx: a.data.data });
|
||||
}),
|
||||
(o = { model: "classtype", key: a.globalData.Key }),
|
||||
a.getdata(o, "GetData/getDataclasstype").then((a) => {
|
||||
console.log("回调分类数据:", a.data.data),
|
||||
e.setData({ dh: a.data.data });
|
||||
});
|
||||
},
|
||||
redirectTo: function (a) {
|
||||
var t = a.currentTarget.dataset.page,
|
||||
e = a.currentTarget.dataset.id,
|
||||
o = a.currentTarget.dataset.appid;
|
||||
console.log(a),
|
||||
o
|
||||
? wx.navigateToMiniProgram({
|
||||
appId: o,
|
||||
path: t,
|
||||
extarData: { open: "happy" },
|
||||
envVersion: "release",
|
||||
success(a) {},
|
||||
})
|
||||
: wx.navigateTo({ url: t + "?id=" + e });
|
||||
},
|
||||
tongzhi: function (t) {
|
||||
var e = this,
|
||||
o = e.data.dyId;
|
||||
o &&
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: [o],
|
||||
success(t) {
|
||||
if ("accept" == t[o]) {
|
||||
e.setData({ sets: "0" });
|
||||
var i = e.data.userdata.openid;
|
||||
console.log(i),
|
||||
i &&
|
||||
a.util.request({
|
||||
url: "entry/wxapp/addtemplateid",
|
||||
data: { templateid: o, openid: i },
|
||||
header: { "content-type": "application/json" },
|
||||
success: function (a) {
|
||||
console.log(a);
|
||||
},
|
||||
});
|
||||
} else
|
||||
wx.showToast({ title: "订阅失败" }), e.setData({ sets: "1" });
|
||||
},
|
||||
fail(a) {
|
||||
console.log(a);
|
||||
},
|
||||
complete(a) {
|
||||
console.log(a);
|
||||
},
|
||||
});
|
||||
},
|
||||
onReady: function () {},
|
||||
onShow: function () {},
|
||||
onHide: function () {},
|
||||
onUnload: function () {},
|
||||
onPullDownRefresh: function () {},
|
||||
onReachBottom: function () {},
|
||||
onShareAppMessage: function () {
|
||||
return {
|
||||
title: "汽车查查-今日油价查询,查询你的城市油价",
|
||||
path: "/packageA/pages/yjcx/yjcx",
|
||||
success: function (a) {
|
||||
console.log(a);
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
4
packageA/pages/yjcx/yjcx.json
Normal file
4
packageA/pages/yjcx/yjcx.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "油价查询",
|
||||
"usingComponents": {}
|
||||
}
|
||||
31
packageA/pages/yjcx/yjcx.wxml
Normal file
31
packageA/pages/yjcx/yjcx.wxml
Normal file
@@ -0,0 +1,31 @@
|
||||
<view class="message-content">
|
||||
<ad apid="{{hfad}}" appid="{{adappid}}" class="ad" type="banner" wx:if="{{hfad}}"></ad>
|
||||
<view class="wss main ">
|
||||
<image mode="widthFix" src="https://bkxzs.carzhishi.com/static/yjcx.jpg" style="width: 100%;"></image>
|
||||
<text style="color:#3688FF;">【你当前城市:{{yjdata.province}},{{yjdata.date}}的油价如下】</text>
|
||||
<text>{{yjdata.info2.news}}</text>
|
||||
</view>
|
||||
<view class="message-content wss">
|
||||
<view>
|
||||
<view class="main">
|
||||
<view class="main_top">
|
||||
<view>汽油型号</view>
|
||||
<view>最新油价</view>
|
||||
<view>涨跌幅</view>
|
||||
</view>
|
||||
<view bindtap="imgPreview" class="main_info" data-src="{{item.word}}" style="border-bottom:1rpx solid #EEEEEE" wx:for="{{yjcx}}" wx:key="index">
|
||||
<view style="color:#3688FF;">{{item.name}}</view>
|
||||
<view>{{item.value}}元</view>
|
||||
<view class="amount_of_increase">
|
||||
<image src="{{item.value>8?'/images/333_02.png':'/images/334_02.png'}}"></image>
|
||||
<view class="float {{item.value>8?'red':'green'}}">{{item.value}}元</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="search-button" openType="share">转发给好友</button>
|
||||
<view class="adjg2" style="height:50px;"></view>
|
||||
<view class="adjg2"></view>
|
||||
<ad apid="{{xxlad}}" appid="{{adappid}}" class="ad" type="feed" wx:if="xxlad"></ad>
|
||||
</view>
|
||||
122
packageA/pages/yjcx/yjcx.wxss
Normal file
122
packageA/pages/yjcx/yjcx.wxss
Normal file
@@ -0,0 +1,122 @@
|
||||
.wss text {
|
||||
color: #03a125;
|
||||
display: block;
|
||||
font-size: 13px;
|
||||
line-height: 44rpx;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.main_info > view {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.top {
|
||||
height: 400rpx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
.top_bg {
|
||||
margin-top: -6rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.top_title {
|
||||
color: #060606;
|
||||
margin-left: 27rpx;
|
||||
position: absolute;
|
||||
}
|
||||
.top_info {
|
||||
background: #fff;
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.11);
|
||||
height: 300rpx;
|
||||
line-height: 84rpx;
|
||||
margin-left: 10%;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 210rpx;
|
||||
width: 80%;
|
||||
}
|
||||
.top_info > .top_info_title {
|
||||
font-family: fangsong;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
.top_info > .top_info_money {
|
||||
color: #fdc770;
|
||||
font-size: 40rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.top_info > .top_info_time {
|
||||
color: #c6c4c4;
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.main {
|
||||
margin-left: 2%;
|
||||
margin-top: 10rpx;
|
||||
width: 94%;
|
||||
}
|
||||
.main_top {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
.main_top > view {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
height: 80rpx;
|
||||
justify-content: center;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
width: 20%;
|
||||
}
|
||||
.main_info {
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
}
|
||||
.main_info > view {
|
||||
font-size: 34rpx;
|
||||
justify-content: center;
|
||||
line-height: 100rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
width: 25%;
|
||||
}
|
||||
.main_info > .amount_of_increase {
|
||||
position: relative;
|
||||
}
|
||||
.main_info .amount_of_increase > .float {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: -30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.main_info > .amount_of_increase image {
|
||||
height: 70rpx;
|
||||
left: 0;
|
||||
margin-left: 10%;
|
||||
position: absolute;
|
||||
top: -28rpx;
|
||||
width: 80%;
|
||||
}
|
||||
.main_info > .btn {
|
||||
color: #fff;
|
||||
height: 120rpx;
|
||||
line-height: 120rpx;
|
||||
text-align: center;
|
||||
width: 20%;
|
||||
}
|
||||
.main_info > .btn > span {
|
||||
background: #fdc770;
|
||||
border-radius: 30rpx;
|
||||
color: #fff;
|
||||
font-size: 22rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
width: 20%;
|
||||
}
|
||||
.red {
|
||||
color: red;
|
||||
}
|
||||
.green {
|
||||
color: green;
|
||||
}
|
||||
Reference in New Issue
Block a user