开发小程序如何导入图片作为背景图?

我想将一张图片当做小程序背景进行使用,因为图片太大了所以我选择先传到Gitee上,但是在导入过程中却报错了:

img

img

我的代码是这样的:

  <view>
    <view class='background'>
      <view class="temp">12°view>
      <view class='weather'>晴天view>
    view>
<style lang="scss">
  page {
    width: 100%;
    height: 100%;
  }
.temp{
  text-align: center;
  font-size: 200rpx;
  line-height:1.4;
  opacity: 0.8;
}
.weather{
  text-align: center;
  font-size:40rpx;
  line-height:1.4;
  opacity:0.65;
}
.background{
  background-image: url("https://gitee.com/lalalalaooooo/pict.git");
  padding-top: 174rpx;
  padding-bottom: 250rpx;
  background-repeat: no-repeat;
  background-size: 100% 100%;
style>

我是通过“下载”那里获取的图片链接

img

请问不能通过这样的方式引入吗?我该如何解决?

我一般都是先压缩,然后转成base64
你这放在别人服务器总感觉不稳定,而且格式也不对

尝试部署到服务器上,以网络图片的方式 访问