Skip to content

Commit 325e5b4

Browse files
committed
将图片源换成云开发
1 parent c11174a commit 325e5b4

30 files changed

+379
-173
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
1111
谢谢!
1212

13-
13+
# License
14+
MIT

miniprogram/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ App({
3939

4040
globalData: {
4141
userInfo: null,
42-
url: "https://pku-lostangel.oss-cn-beijing.aliyuncs.com/",
42+
url: "cloud://sccapku-2b02q.7363-sccapku-2b02q-1301706491/catPhotos/",
4343
},
4444

4545

miniprogram/app.json

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@
136136
"pages/cats/美学/美学",
137137
"pages/cats/唐璜/唐璜",
138138
"pages/cats/夕云/夕云",
139-
"pages/cats/甜椒/甜椒",
140139
"pages/cats/岭北/岭北",
141140
"pages/cats/漠北/漠北",
142141
"pages/cats/楚天阔/楚天阔",
@@ -147,42 +146,6 @@
147146
"pages/cats/三姐/三姐",
148147
"pages/cats/四哥/四哥",
149148
"pages/cats/五哥/五哥",
150-
"pages/cats/小美/小美",
151-
"pages/cats/左智/左智",
152-
"pages/cats/八二/八二",
153-
"pages/cats/双皮奶/双皮奶",
154-
"pages/cats/夕立/夕立",
155-
"pages/cats/鸡腿/鸡腿",
156-
"pages/cats/寿司/寿司",
157-
"pages/cats/路易/路易",
158-
"pages/cats/莫可/莫可",
159-
"pages/cats/水井/水井",
160-
"pages/cats/藕带/藕带",
161-
"pages/cats/六姐/六姐",
162-
"pages/cats/夕照/夕照",
163-
"pages/cats/鸡翅/鸡翅",
164-
"pages/cats/黄小孙女/黄小孙女",
165-
"pages/cats/泡菜/泡菜",
166-
"pages/cats/拂尘/拂尘",
167-
"pages/cats/白樱/白樱",
168-
"pages/cats/大福/大福",
169-
"pages/cats/麈尾/麈尾",
170-
"pages/cats/鸡米花/鸡米花",
171-
"pages/cats/凤爪/凤爪",
172-
"pages/cats/蒜香鸡/蒜香鸡",
173-
"pages/cats/安宝/安宝",
174-
"pages/cats/谦儿/谦儿",
175-
"pages/cats/于连/于连",
176-
"pages/cats/哈娜/哈娜",
177-
"pages/cats/银桂/银桂",
178-
"pages/cats/金桂/金桂",
179-
"pages/cats/奶油鸡/奶油鸡",
180-
"pages/cats/黄连/黄连",
181-
"pages/cats/西瓜/西瓜",
182-
"pages/cats/英华/英华",
183-
"pages/cats/绯云/绯云",
184-
"pages/cats/云苓/云苓",
185-
"pages/cats/鸡柳/鸡柳",
186149

187150
"pages/about/about",
188151
"pages/logs/logs",
@@ -219,6 +182,6 @@
219182
"pagePath": "pages/about/about"
220183
}
221184
]
222-
},
223-
"lazyCodeLoading": "requiredComponents"
185+
}
186+
224187
}

miniprogram/pages/about/about.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Page({
6262
})
6363
},
6464
codeimgdata: {
65-
images:"https://pku-lostangel.oss-cn-beijing.aliyuncs.com/二维码.jpg",
66-
imgList:["https://pku-lostangel.oss-cn-beijing.aliyuncs.com/二维码.jpg"]
65+
images:"cloud://sccapku-2b02q.7363-sccapku-2b02q-1301706491/catPhotos/二维码.jpg",
66+
imgList:["cloud://sccapku-2b02q.7363-sccapku-2b02q-1301706491/catPhotos/二维码.jpg"]
6767
},
6868
previewImg:function(e){
6969
console.log(1);

miniprogram/pages/about/about.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<view class="head1">联系我们</view>
3232

3333
<view style="display:flex; justify-content:center; align-items:center;" bindtap="previewImg">
34-
<image mode="widthFix" src="https://pku-lostangel.oss-cn-beijing.aliyuncs.com/二维码.jpg" style= "width: 93%;">
34+
<image mode="widthFix" src="cloud://sccapku-2b02q.7363-sccapku-2b02q-1301706491/catPhotos/二维码.jpg" style= "width: 93%;">
3535
</image>
3636
</view>
3737

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
//index.js
2+
3+
var cat_id = "1";
4+
5+
Page({
6+
data: {
7+
cat: {},
8+
markers: [],
9+
photoscr: "",
10+
},
11+
12+
/**
13+
* 生命周期函数--监听页面加载
14+
*/
15+
onLoad: function (options) {
16+
cat_id = options.cat_id;
17+
const that = this;
18+
console.log("加载detail页码");
19+
// console.log(cat_id);
20+
const db = wx.cloud.database();
21+
db.collection('cat').doc(cat_id).get().then(res => {
22+
console.log(res);
23+
24+
this.setData({
25+
cat: res.data,
26+
photoscr: "https://6369-circle-test-zdk23-1259206269.tcb.qcloud.la/%E4%BC%9A%E5%BE%BD/" + res.data.name + ".png"
27+
});
28+
}).then(res => {
29+
var number = 0
30+
for (var i in this.data.cat.markers) {
31+
var marker = [
32+
{
33+
iconPath: "https://6369-circle-test-zdk23-1259206269.tcb.qcloud.la/%E4%BC%9A%E5%BE%BD/" + encodeURIComponent(this.data.cat.name) + ".png",
34+
latitude: this.data.cat.markers[i].latitude,
35+
longitude: this.data.cat.markers[i].longitude,
36+
width: 50,
37+
height: 50,
38+
id: number,
39+
}
40+
]
41+
this.setData({
42+
markers: this.data.markers.concat(marker),
43+
});
44+
// console.log(this.data.markers)
45+
number++
46+
}
47+
});
48+
49+
},
50+
51+
includePointsOne() {
52+
const mapCtx = wx.createMapContext('map', this);
53+
mapCtx.includePoints({
54+
padding: [60, 36, 0, 36],
55+
points: this.data.markers,
56+
success: res => {
57+
console.log('includePoints success');
58+
},
59+
fail: err => {
60+
console.log('includePoints fail', err);
61+
}
62+
});
63+
},
64+
65+
66+
onShow: function (options) {
67+
68+
},
69+
70+
71+
regionchange(e) {
72+
console.log(e.type)
73+
},
74+
markertap(e) {
75+
console.log(e.detail.markerId)
76+
},
77+
controltap(e) {
78+
console.log(e.detail.controlId)
79+
},
80+
81+
onShareAppMessage: function (res) {
82+
if (res.from === 'button') {
83+
// 来自页面内转发按钮
84+
console.log(res.target)
85+
}
86+
return {
87+
title: this.data.cat.name,
88+
path: '/pages/catDetail/catDetail?cat_id=' + this.data.cat._id,
89+
success: function (res) {
90+
// 转发成功
91+
},
92+
fail: function (res) {
93+
// 转发失败
94+
}
95+
}
96+
},
97+
98+
onShareTimeline: function (res) {
99+
if (res.from === 'button') {
100+
// 来自页面内转发按钮
101+
console.log(res.target)
102+
}
103+
return {
104+
title: this.data.cat.name,
105+
path: '/pages/catDetail/catDetail?cat_id=' + this.data.cat._id,
106+
success: function (res) {
107+
// 转发成功
108+
},
109+
fail: function (res) {
110+
// 转发失败
111+
}
112+
}
113+
},
114+
onPullDownRefresh: function () {
115+
wx.stopPullDownRefresh()
116+
},
117+
copyBili: function (e) {
118+
var self = this;
119+
wx.setClipboardData({
120+
data: this.data.cat.officialAccount['bili'],//需要复制的内容
121+
success: function (res) {
122+
console.log("复制成功")
123+
}
124+
})
125+
},
126+
127+
naviToMini: function (e) {
128+
wx.navigateToMiniProgram({
129+
appId: this.data.cat.officialAccount['miniprogram'],
130+
// path: 'pages/index/index',
131+
envVersion: 'release',
132+
success(res) {
133+
// 打开成功
134+
}
135+
})
136+
},
137+
naviToMini1: function (e) {
138+
wx.navigateToMiniProgram({
139+
appId: this.data.cat.officialAccount['miniprogram1'],
140+
// path: 'pages/index/index',
141+
envVersion: 'release',
142+
success(res) {
143+
// 打开成功
144+
}
145+
})
146+
}
147+
148+
})
149+
150+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<view style="display:flex; justify-content:center; align-items:center;">
2+
<image mode="widthFix" class="cat_image" src="{{url}}{{catname}}.jpg" style="width: 90%;">
3+
</image>
4+
</view>
5+
6+
7+
<view class="itemname1">
8+
<view style='flex-shrink:0; box-sizing:border-box; width:350rpx;'>
9+
<view class="cat-card">{{catname}}</view>
10+
</view>
11+
<view style='flex-shrink:0; box-sizing:border-box; width:350rpx;'>
12+
<!-- 猫叫声 -->
13+
<view class="sound">
14+
<block wx:for="{{audioArr}}" wx:key="content" wx:for-item="v" wx:for-index="key">
15+
16+
<!-- 默认状态 未播放 -->
17+
<view wx:if="{{!v.bl}}" bindtap='audioPlay' data-key="{{key}}" data-id="{{v.id}}" data-bl="{{v.bl}}">
18+
<image class="play" src="/pages/images/play.png"></image>
19+
</view>
20+
21+
<!-- 当前正在播放状态 -->
22+
<view wx:if="{{v.bl}}" bindtap='audioStop' data-key="{{key}}" data-id="{{v.id}}" data-bl="{{v.bl}}">
23+
<image class="play" src="/pages/images/pause.png"></image>
24+
</view>
25+
26+
</block>
27+
</view>
28+
</view>
29+
</view>
30+
31+
32+
<view class="itemname1">
33+
<view wx:for="{{catitems}}">
34+
<view style='flex-shrink:0; box-sizing:border-box; width:350rpx;'>
35+
{{item.category}}
36+
</view>
37+
<view class="itemname2">{{item.content}}</view>
38+
</view>
39+
</view>
40+
41+
<view wx:if="{{relationship[0]}}" class="itemname1">
42+
<navigator wx:for="{{relationship}}" url="/pages/cats/{{item.rela}}/{{item.rela}}">
43+
<view style='flex-shrink:0; box-sizing:border-box; width:3rem; margin-right:1rem;'>
44+
<image style="width:3rem;height:3rem;" src="{{url}}{{item.rela}}.png"></image>
45+
<view style="text-align: center; color:#353535;"> \n {{item.rela}} </view>
46+
</view>
47+
</navigator>
48+
</view>
49+
50+
51+
52+
<text> \n </text>
53+
54+
<block wx:for="{{nums}}">
55+
56+
<view style="display:flex; justify-content:center; align-items:center;">
57+
<image mode="widthFix" class="cat_image" src="{{url}}{{catname}}{{item.num}}.jpg" style="width: 90%;">
58+
</image>
59+
</view>
60+
61+
<text> \n </text>
62+
63+
</block>
64+
65+
<block wx:for="{{MovieNums}}">
66+
67+
<view style="display:flex; justify-content:center; align-items:center;">
68+
<video mode="widthFix" class="cat_image" src="{{url}}{{catname}}{{item.num}}.mp4" style="width: 90%;">
69+
</video>
70+
</view>
71+
72+
<text> \n </text>
73+
74+
</block>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/OrganDetail/OrganDetail.wxss */
File renamed without changes.

0 commit comments

Comments
 (0)